I would suggest you to use below instead of JCO_AHOST and JCO_SYSNR:
Use JCO_R3NAME with system ID of the target host
Use JCO_MSHOST with message server host name or IP address
Use JCO_MSSERV with message server port number
Use JCO_GROUP with the name of the logon group
You can refer to below link to check a working example:
https://sourceforge.net/p/rcer/git/ci/master/tree/net.sf.rcer.conn