For ALE inbound event processing, the adapter acts as a Remote
Function Call (RFC) Server by listening for ALE events from an SAP system.
The adapter spawns listener threads to the SAP system. Whenever an event occurs
in SAP, the event is pushed to the adapter via the event listeners.
The listener
threads listen continuously in a synchronous manner for ALE events coming
from the ALE-specific functions that the adapter supports. The threads do
the following:
- Use a program identifier to register with the SAP Gateway
- Identify to the SAP Gateway the ALE-specific RFC-enabled functions that
they support. These functions are idoc_inbound_asynchronous and inbound_idoc_process.
- Receive events from the ALE-specific function.
The following diagram illustrates the flow of inbound events between the
SAP system and the adapter:

ALE inbound processing
The adapter receives the event from SAP and then converts it into a business
object before sending it to the message endpoint on the client application.
Note that the adapter can deliver objects to endpoints that support transactions
as well as endpoints that do not support transactions:
- For endpoints that support transactions, the adapter delivers the business
object as part of a unique XA transaction (a two-phase commit transaction)
controlled by the application server. The message endpoint must be configured
to support XA transactions.
- For endpoints that do not support transactions, the adapter delivers the
business object to the endpoint. The event delivery is guaranteed only when
XA transaction processing is supported.
- The adapter supports the tRFC protocol for delivering ALE events from
the SAP system to the endpoint (client application).
Although tRFC significantly improves the reliability of the data transfer,
it does not ensure that the order of ALE transactions specified in the application
is observed. Event ordering is also affected by the number of listener threads.
However, at some point all ALE transactions are transferred. For further details
about tRFC, refer to the SAP documentation.