IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

RFC: SAP BC -> SAP with Tables

  • 1.  RFC: SAP BC -> SAP with Tables

    Posted Sat January 12, 2008 05:04 PM

    Hello,

    I wrote an function module with ABAP. The function has a table parameter.
    In the fm I read the table and modify some value.

    Then I generated a service in the Business Connector.
    If I test the service it works fine.

    But if I call the service from a Java service it doesn’t work. More precisely: I can send and receive string parameters and send the table parameter but when I read the table parameter is always empty.

    Here the code:[INDENT]String nr = “[”;

    // input
    IData input = IDataFactory.create();
    IDataCursor inputCursor = input.getCursor();

    // DATA
    IData[] DATA = new IData[1];
    DATA[0] = IDataFactory.create();
    IDataCursor DATACursor = DATA[0].getCursor();
    IDataUtil.put( DATACursor, “SEGNAM”, “SEGNAM” );
    IDataUtil.put( DATACursor, “FIELDNAME”, “FIELDNAME” );
    IDataUtil.put( DATACursor, “POSNR”, “POSNR” );
    IDataUtil.put( DATACursor, “VALUE1”, “VALUE1” );
    IDataUtil.put( DATACursor, “VALUE2”, “VALUE2” );
    IDataUtil.put( DATACursor, “STATUS”, “STATUS” );
    DATACursor.destroy();
    IDataUtil.put( inputCursor, “DATA”, DATA );
    inputCursor.destroy();

    // output
    IData output = IDataFactory.create();
    try{
    output = Service.doInvoke( “DA”, “TestFuba”, input );
    }catch( Exception e){}
    IDataCursor outputCursor = output.getCursor();
    if (outputCursor.first(“DATA”)) {
    nr = nr + “]uuu[”;
    }
    // DATA
    IData[] DATA_1 = IDataUtil.getIDataArray( outputCursor, “DATA” );
    if ( DATA_1 != null)
    {
    nr = nr + “][” ;
    for ( int i = 0; i < DATA_1.length; i++ )
    {
    IDataCursor DATA_1Cursor = DATA_1[i].getCursor();
    String SEGNAM_1 = IDataUtil.getString( DATA_1Cursor, “SEGNAM” );
    String FIELDNAME_1 = IDataUtil.getString( DATA_1Cursor, “FIELDNAME” );
    String POSNR_1 = IDataUtil.getString( DATA_1Cursor, “POSNR” );
    String VALUE1_1 = IDataUtil.getString( DATA_1Cursor, “VALUE1” );
    String VALUE2_1 = IDataUtil.getString( DATA_1Cursor, “VALUE2” );
    String STATUS_1 = IDataUtil.getString( DATA_1Cursor, “STATUS” );
    DATA_1Cursor.destroy();
    nr = nr + “][” + VALUE1_1;
    }
    }
    outputCursor.destroy();

    // *********************************

    IDataCursor idcPipeline = pipeline.getCursor();


    IDataUtil.put( idcPipeline, “result”, nr );

    idcPipeline.destroy();
    [/INDENT]Thank you for any help.

    Regards,
    Tommaso


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services