Puneet Dev
Puneet Dev

Reputation: 21

WSO2 SAP Adapter : Unable to send tables data in BAPI RFC call

I am trying to make a SAP BAPI RFC call using WSO2 6.2 EI (I also tried WSO2 ESB 5.0.0 with same results). The request xml contains data for input structures and some table data. The input structures data is sent successfully and received at the SAP end. The tables data is not being sent by WSO2 (as observed in the trace files for the SAP call). I had a look at the source code and it seems the issue has already been reported and fixed (https://wso2.org/jira/browse/ESBJAVA-3011) but surprisingly even the latest version of WSO2 still has the old code which still has the issue (unless I am looking in the wrong place) - the org.wso2.carbon.transports.sap_1.0.0.jar (present in the plugins directory).

Below is a sample request:

<body>
<bapirfc xmlns="" name="ZTEMP_CREATE">
<import>
<structure name="LS_ORDER_HEADER_IN">
<field name="DOC_TYPE">ZZZ</field>
<field name="SALES_ORG">1111</field>
</structure>
</import>
<tables> 
<table name="LT_PARTNERS">
<row id="0">
<field name="PARTN_ROLE">DG</field>
<field name="PARTN_NUMB">0000000075</field>
</row>
</table>
</tables>
</bapirfc>
</body>

The import structure data for the structure "LS_ORDER_HEADER_IN" is sent and received successfully. But the tables data "LT_PARTNERS" is being sent as blank from WSO2. Is there a patch or upgrade available for the SAP adaptor for fixing this issue and if so, how can i update my wso2 ei installation to use it?

Upvotes: 0

Views: 671

Answers (2)

Eshwari Lakshmanan
Eshwari Lakshmanan

Reputation: 1

Giving <tables> inside the <import> tag will work.

<body>
<bapirfc xmlns="" name="ZTEMP_CREATE">
<import>
<tables> 
<table name="LT_PARTNERS">
<row id="0">
<field name="PARTN_ROLE">DG</field>
<field name="PARTN_NUMB">0000000075</field>
</row>
</table>
</tables>
</import>
</bapirfc>
</body>

Upvotes: 0

Martin Hald
Martin Hald

Reputation: 676

I'm using ESB 4.8.1 with org.wso2.carbon.transports.sap_1.0.0.jar to make BAPI RFC calls without any problems.

Can you try the following test proxy to see if in general it works?

    <?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="SAPProxy"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <payloadFactory media-type="xml" description="BAPIPayload">
            <format>
               <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
                  <soap:Body>
                     <bapirfc xmlns="" name="Z_CONVERT_IBAN_2_BANK_ACCOUNT">
                        <import>
                           <field name="I_IBAN">123456789</field>
                        </import>
                     </bapirfc>
                  </soap:Body>
               </soap:Envelope>
            </format>
            <args/>
         </payloadFactory>
         <send>
            <endpoint name="sap-endpoint">
               <address uri="bapi:/yourconf"/>
            </endpoint>
         </send>
         <log level="full">
            <property name="step" value="--- AFTER SEND TO SAP 2 --"/>
         </log>
      </inSequence>
      <outSequence>
         <log level="full">
            <property name="step" value="--- RESULT FROM SAP --"/>
         </log>
         <send/>
      </outSequence>
      <faultSequence>
         <log level="full">
            <property name="step" value="--- FAULT --"/>
         </log>
         <drop/>
      </faultSequence>
   </target>
   <description/>
</proxy>

Upvotes: 0

Related Questions