I would like to execute RFC function on explicit destination using JCo.
I've modified existing JCo program StepByStepClient.java
and I'm able to execute RFC function exactly the same way like using SAP GUI se37
when the "RFC target sys" field is empty.
For my demo purposes I was invoking TH_USER_LIST
function.
Then I registered my own JCo server with Program Id MY_PROG_ID
, then added tcpip destination MY_DEST
using sm59
with "Registered Server Program"="MY_PROG_ID
".
I'm now able to invoke TH_USER_LIST
on my JCo server using se37
with RFC target sys = "MY_DEST".
I would like to be able to execute the same implementation of TH_USER_LIST
on my JCo server using JCo client but I'm still invoking the default implementation and not my registered program.
I presumed I just need to assign the destination as a new property like the ones below but it did not help.
connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "appserver");
connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "00");
connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "000");
connectProperties.setProperty(DestinationDataProvider.JCO_USER, "JCOTESTER");
connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "JCOTESTERSPASSWORD");
connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "en");
Please advise