I think you can try write the following code in a java service and then directly invoke a module by giving the necessary parameters.
Something like this !
/********************************/
Values rfcParameters = new Values();
// The parameters required for the function module that you are calling
rfcParameters.put(“IDOC_NUMBER”,idocNumber);
rfcParameters.put(“STATUS”, status);
rfcParameters.put(“$rfcname”, rfcName);
try{
Service.doInvoke(“sap”,“invoke”,rfcParameters);
}catch(Exception e){
e.printStackTrace();
}
/********************************/
To know what all should be passed as part of rfcParameters look into the User Guide.
#Adapters-and-E-Standards#Integration-Server-and-ESB#webMethods