During routine operations, an application on the SAP R/3 system generates a transaction designated for an external system. The ALE interface converts the data from the internal data format to the IDoc format, and sends it via tRFC to the SAP BAPI Adapter, acting as a RFC server.
The Java CAPS Project’s business rules receive the IDoc data from the SAP BAPI Adapter, performs any necessary processing or routing, and sends the information to another Adapter connected to the recipient system. Any necessary data transformation required for the target application is performed in your Project Collaborations.
The Adapter reads in the required configuration parameters and establishes a network connection with the SAP R/3 system. The Adapter acts an RFC server, receiving IDocs from the SAP R/3 system.
When the IDoc is sent from SAP R/3 via tRFC, the SAP BAPI Adapter uses the RFC OTD, IDOC_INBOUND_ASYNCHRONOUS, to receive the IDoc data.
IDoc data received by the IDOC_INBOUND_ASYNCHRONOUS OTD can be marshaled out of the OTD and unmarshaled into a IDoc OTD.
A file-based TID (Transactional ID) database is used to track transactions that have been committed successfully or rolled back.
If identified successfully, the process moves on to the next step. If not, the Adapter composes the appropriate response and logs an exception in the log file.
If the Collaboration or Business Process fails, an exception is logged in the log file raised back to SAP R/3.
The Adapter then repeats the procedure beginning with step 2.
In the outbound mode, you must first get the data into the IDoc OTD using its unmarshal method. From the IDoc OTD, you unmarshal the data into the IDOC_INBOUND_ASYNCHRONOUS RFC OTD which sends the IDoc to SAP R/3 using tRFC protocol.
When the Collaboration or Business Process starts to run, the Adapter is initialized with its configuration properties.
The data is unmarshaled to the IDoc OTD before being sent to the SAP BAPI Adapter’s RFC OTD---IDOC_INBOUND_ASYNCHRONOUS.
The SAP BAPI Adapter transmits the data to SAP R/3.
The SAP BAPI Adapter associates the next TID (from a persistent resetable counter) with the transformed outbound message and sends it via tRFC to the SAP R/3 host.
If no exceptions are raised by the receiving SAP R/3 host, the next TID is incremented.
The Adapter repeats the procedure beginning with step 2.
Messages are sent to the SAP R/3 host via Transactional RFC (tRFC). With tRFC, the receiving SAP R/3 system relies on an unique Transactional ID (TID) sent with the message to ascertain whether or not a transaction has ever been processed by it before. The SAP BAPI Adapter assumes that all messages handled are new and assigns a new TID to each message.
If you have IDoc data in a byte array format you may unmarshal it directly to the IDOC_INBOUND_ASYNCHRONOUS OTD without using the IDoc OTD first.