Skip to Content
author's profile photo
Former Member

Passing table to RFC in Java iview

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Aug 19, 2004 at 11:42 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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