cancel
Showing results for 
Search instead for 
Did you mean: 

Passing table to RFC in Java iview

Former Member
0 Kudos

Hi - I am trying to pass a table to an RFC. No error on the RFC call - but no data is being passed in the table either...any recomendation on what I am missing - here is my code:

public String submitOrder(JCO.Table iTab, String iType) {

String errMsg = "";

JCO.Function function = null;

try {

functionRepository = new JCO.Repository("custCSM", sapConnection);

function = this.createFunction("Z_RFC_POST_IDOC_1");

function.getImportParameterList().setValue(iType, "BUILD_SHIP");

function.getTableParameterList().setValue(iTab, "ZIDOC_POST");

sapConnection.execute(function);

} catch (Exception e) {errMsg = "Submission had errors. Order not Submitted.";

e.printStackTrace();}

return errMsg;

}

many thanks - Janet

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Janet

I can give you a pointer here.

just plug in either of these calls just before the execute

function.writeXML("C:/call.xml");

(This will print out data you are trying to send in an XML file )

or

sapConnection.setAbapDebug(true);

(This will open a SAP gui with the Function Module in debug mode , you can then double click the table params to see if it is populated)

Regards

Pran

Former Member
0 Kudos

Pran - thanks for the debug suggestion - we had modified the FM to write out the table entries to find it did not seem to be passing anything - is there something special on the call that is different for passing a table?

Janet

Former Member
0 Kudos

Hi Janet

This is typically the way you populate table data , have you done it this way?

JCO.ParameterList jcoParamTab = jcoFunc.getTableParameterList();

JCO.Table jcoTab = jcoParamTab.getTable("<TABLEPARAM>");

jcoTab.appendRow();

jcoTab.setValue("<VALUE1>","<FIELD1>");

jcoTab.setValue("<VALUE2>","<FIELD2>");

Regards

Pran