In SAP, you can call functions in other applications or SAP systems that are registered with SAP as remote function call (RFC) servers. In IBM® Integration Bus, you can register the SAP adapter with SAP as an RFC server so that it accepts synchronous and asynchronous calls from SAP.
In SAP, a BAPI interface is a function call. If a system is connected to SAP as an RFC server, you can use the BAPI interface to define the interface where a program running in SAP can call an external system. The external system is identified in SAP by its RFCDestination value, which is bound to a program ID in SAP administration. The program ID is specified by the external system when it first connects to SAP.
By using the WebSphere® Adapter for SAP, a message flow can connect to SAP as an RFC Server by configuring the adapter with the relevant program ID and deploying the message flow to the integration node. After deployment, the message flow can receive synchronous function calls by using the BAPI interface.
The BAPI import parameters are received by the adapter and propagated from an SAPInput node as a message tree structure. The BAPI export parameters are propagated to an SAPReply node as a message tree structure. The adapter then sends back the export parameters to the calling SAP program. In this case, the SAPReply node is typically in the same flow as the SAPInput node. The SAPInput node provides a unique ID (the reply identifier) for each BAPI call. The reply identifier is propagated to the SAPReply node (in the local environment) to indicate to which BAPI call it is replying.
If no reply identifier exists in the local environment, the SAPReply node automatically uses the reply identifier from the SAPInput node that triggered the current execution of the message flow. If the flow is triggered by anything but an SAPInput node, or if a break occurs in the flow, an error is issued. An unhandled exception in the message flow causes a system failure in SAP.
Even if the BAPI does not expect any output parameters, the (empty) message must be propagated to the SAPReply node.
You can process two concurrent callouts from SAP by configuring the message flow with an additional instance.
Scenario 1
The following diagram represents a message flow where IBM Integration Bus provides a link between SAP and a target application (in this case, DB2®) The SAP program requires reply data, therefore it blocks further processing until the call completes.
Scenario 2
The following diagram also represents a message flow where the SAP program requires reply data, but in this scenario, calls between IBM Integration Bus and the target application (in this case, WebSphere MQ) are asynchronous. The SAP system blocks further processing until the call completes. If the value of the SAP Maximum client wait time property is insufficient, or if it is set to 0, then a timeout error might be generated. For more information about the Maximum client wait time property of the SAP Input Node, see Maximum client wait time (secs). When you use the SAPReply node in a different flow from the SAPInput node, deploy the SAPReply node in the same integration server as the SAPInput node.
Scenario 3
The following diagram represents an asynchronous call from SAP to IBM Integration Bus, and an asynchronous call from IBM Integration Bus to a target application. This scenario shows how you can combine the inbound processing that is described in this topic with outbound processing to achieve the same result as in scenarios 1 and 2. For more information about outbound processing, see Outbound processing for the BAPI interface.