Thursday, January 13, 2011

BAPI and ALE Integration


The objective of "Business Application Programming Interfaces" (BAPIs) and "Application Link Enabling" integration is to enable future ALE scenarios to use BAPI interfaces. One advantage is that it will be much easier for both SAP Development and SAP customers to develop new ALE scenarios. Another advantage is that BAPI interfaces will be able to use already existing ALE functions, (e.g. error handling and writing links asynchronously).
Further advantages are:
  • object oriented approach
  • application maintains one interface only
  • reduction of generation program errors
Description of Function
When a BAPI is defined, ALE outbound and inbound interfaces are generated and entered in transport requests, provided that the following functions are generated at the time the BAPI is defined:
  • an IDoc type and its segments (IDoc = intermediate document)
  • a "wrapper" function module which decides whether the BAPI is called locally or from another system (see Overview Graphic). Local calls can call the BAPI immediately or via an IDoc which restarts it.
  • an ALE outbound function module which puts BAPI interface data into an IDoc and triggers ALE outbound processing
  • an ALE inbound function module which transfers BAPI interface data from an IDoc into the BAPI interface structure and calls the BAPI
  • ALE customizing for the new interface.
The flow diagram in the Overview Graphic shows the run time BAPI call flow logic.
The generation can also be used when an R/3 System is connected to a non-R/3 System. "One-way" means that either outbound or inbound but not both is implemented in the R/3 System. This means that a one-way interface cannot be used to exchange data between two R/3 Systems.
The generation can only be used for asynchronous interfaces, i.e. a receiver processes data without return parameters to the sender.
In principle the generation can also be used to support an IDoc interface for Electronic Data Interchange (EDI).



To call up the BAPI "BAPI_X_CREATE" in System 1, the program calls the generated "wrapper" function module "ALE_X_CREATE" whose interface contains all the BAPI interface parameters.
Application Area
All applications which create a write BAPI can use this functionality, especially when the BAPI is to be called from another R/3 System. Customers developing their own ALE scenarios also benefit from these advantages.