none
How to retrive BAPI Tables values in the BAPI Response RRS feed

  • Question

  • When I call a BAPI  - CSAP_MAT_BOM_READ, the response message does not contain values in the Tables elements. The Generated BAPI Schema has the Tables elements, but on execution these tables elements are not created.

    How to configure the BAPI Send port to retrieve Tables data of a BAPI in Orchestration.

    or How to make Tables as part of export parameters of a BAPI.

    I executed the same BAPI in SAP, I get the response BOM data in the Tables.


    Ashi
    Monday, May 17, 2010 8:22 PM

Answers

  • Hi Ashith,

    You don't need to modify the generated SAP schema.

    If you look at the BAPI Request XML message you are sending to SAP, I'm assuming from what you've described that it will not have a RETURN element populated. You need to ensure there is an empty RETURN element (as Oliver mentioned) to tell the adapter that you want the RETURN element populated in the BAPI Response message.

    So , if you are using a Map to transform your own XML message into the BAPI Request XML message, make sure to set the RETURN element to an empty element. If you are simply hand crafting an XML message for the BAPI Request schema, simply add that empty element and you should see the RETURN element populated in the response.

    I hope that helps.

    Cheers.
    Mike

    • Marked as answer by Ashi Thursday, May 20, 2010 1:19 PM
    Wednesday, May 19, 2010 12:07 AM
  • Or simply fill every "return node" in a map with a space or true. This generated the node and you should get a request.

    This could also be a port map if you wouldn't have an orchestration.

     


    If you like my post or consider it as a valid answer, please use the buttons to show me - Oliver
    • Marked as answer by Ashi Thursday, May 20, 2010 1:19 PM
    Wednesday, May 19, 2010 2:24 AM

All replies

  • Hi Ashi,

    Make sure you create an empty table for any structure you want populated in the return. If you're using the adapter in code, it would be something like

    microsoft.lobservices.sap._2007._03.Types.Rfc.RFCCUST[] customers = new microsoft.lobservices.sap._2007._03.Types.Rfc.RFCCUST[0];

    and if you're calling the BAPI from BizTalk you'll need to make sure you have an empty XML element for every structure you want populated in the response.

    This is the default behavior for performance reasons, so you can control how much information is returned to you over the wire.

    Cheers.
    Mike

    Tuesday, May 18, 2010 12:40 AM
  • If you got the request from outside BizTalk and just doing a bit mapping inside, make sure that every tables node you need in the response message is at least set with empty values: <x1:myTablesNode />

    In other cases, no value will be returned - regardless of what SAP is delivering.

    This is only valid for TABLES patameters. IMPORTING, EXPORTING and CHANGING are working without this "performance safer".

     


    If you like my post or consider it as a valid answer, please use the buttons to show me - Oliver
    Tuesday, May 18, 2010 5:40 AM
  • Thank you for the quick response.

    I'm using BizTalk Orchestration to invoke the BAPI - CSAP_MAT_BOM_READ

    Should I modify the generated schemas' Table nodes as min occurs as "1" in the BAPI Reponse schema, This would ensure an empty element is created.

    I try this option.


    Ashi
    • Edited by Ashi Thursday, May 20, 2010 1:19 PM
    Tuesday, May 18, 2010 2:39 PM
  • Hi Ashith,

    You don't need to modify the generated SAP schema.

    If you look at the BAPI Request XML message you are sending to SAP, I'm assuming from what you've described that it will not have a RETURN element populated. You need to ensure there is an empty RETURN element (as Oliver mentioned) to tell the adapter that you want the RETURN element populated in the BAPI Response message.

    So , if you are using a Map to transform your own XML message into the BAPI Request XML message, make sure to set the RETURN element to an empty element. If you are simply hand crafting an XML message for the BAPI Request schema, simply add that empty element and you should see the RETURN element populated in the response.

    I hope that helps.

    Cheers.
    Mike

    • Marked as answer by Ashi Thursday, May 20, 2010 1:19 PM
    Wednesday, May 19, 2010 12:07 AM
  • Or simply fill every "return node" in a map with a space or true. This generated the node and you should get a request.

    This could also be a port map if you wouldn't have an orchestration.

     


    If you like my post or consider it as a valid answer, please use the buttons to show me - Oliver
    • Marked as answer by Ashi Thursday, May 20, 2010 1:19 PM
    Wednesday, May 19, 2010 2:24 AM
  • Thank you for the response.

    I modified the Map to send empty tables nodes of the BAPI Request Schema and I was able to retrieve the required BAPI Response Tables.

    Ashi


    Ashith Raj
    Thursday, May 20, 2010 1:21 PM