This is the home page of BAPI
BAPI technology (Business Application Programming Interface) is the main API technology available to customers to read and update data, that may be called from within SAP or externally using RFC protocol and ALE/IDoc technology.
This is a concept mainly based on Business Object types (SWO1 transaction) and closely related to ALE/IDoc technology (see demo chapter below).
BAPI term is also used to refer to a function module whose name starts with BAPI (which anyway should be reserved to function modules that belong to BAPI technology).
A BAPI corresponds to a method of the corresponding Business Object type, and it adopts the method's name. BAPI naming convention is: <Name space>BAPI_<business object>_<method>. It is 30 characters maximum. You may abbreviate each part of it if needed, for example BAPI_FLBOOKING_CREATEFROMDATA for method CreateFromData of object type FlightBooking.
- Replicate or SaveReplica
- Address Parameters
- Change Parameters
- Extension Parameters
- Return Parameters (Error Handling)
- Selection Parameters
- Test Run Parameters
- Text Transfer Parameters
Passing custom fields
Custom fields may be passed using EXTENSIONIN and EXTENSIONOUT parameters of the BAPI function module. This example in SAP Library shows how to fill EXTENSIONIN when there are few custom fields, as SAP says in its example: "take care that you have 960 bytes in pieces of 240 byte. Luckily we have less than 240 byte so we need only one move".
So that to work all the time, you may call the following routine to ease the initialization of EXTENSIONIN parameter:
Example of use:
For more information, see SAP Library - BAPI - Customer Enhancement and Modification of BAPIs (CA-BFA)
You may have a loot at Flight Data Application.
SFLCONN, SFLIGHT and SFLTRIP business objects (SWO1 transaction) use respectively these BAPIs:
- BAPI_FLCONN_GETDETAIL, BAPI_FLCONN_GETLIST
- BAPI_FLIGHT_CHECKAVAILIBILITY, BAPI_FLIGHT_GETDETAIL, BAPI_FLIGHT_GETLIST, BAPI_FLIGHT_SAVEREPLICA
- BAPI_FLTRIP_CANCEL, BAPI_FLTRIP_CREATE, BAPI_FLTRIP_GETLIST.
Method SaveReplica of business object SFLIGHT (BAPI_FLIGHT_SAVEREPLICA) has been wrapped into IDoc message type FLIGHT_SAVEREPLICA (BDBG transaction).
SAPBC_REPLICATE_FLIGHTS program creates a flight by using IDoc message type FLIGHT_SAVEREPLICA (and so it finally calls the BAPI).