BAPI
BAPIs (Business Application Programming Interfaces) are stable, released function modules for accessing SAP business objects programmatically, a classic, reliable way to create and read SAP data from code and other systems.
BAPIs remain widely used, but for cloud and modern integration, released OData APIs are increasingly preferred.
- A BAPI is a remote-enabled, released function module representing an operation on a business object, e.
- Most BAPIs do not commit, call BAPI_TRANSACTION_COMMIT.
- Always check the RETURN table for errors.
- Watch out: Forgetting the commit.
What a BAPI is
A BAPI is a remote-enabled, released function module representing an operation on a business object, e.g. BAPI_SALESORDER_CREATEFROMDAT2 or BAPI_MATERIAL_GET_DETAIL. Because BAPIs are part of a stable, supported interface and enforce SAP’s business logic, they are the safe way to programmatically manipulate SAP data.
Calling pattern
CALL FUNCTION 'BAPI_...' EXPORTING ... TABLES return = lt_return ...
" check lt_return for type E/A, then:
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = abap_true.Key rules
- Most BAPIs do not commit, call BAPI_TRANSACTION_COMMIT.
- Always check the RETURN table for errors.
- They are remote-enabled (callable via RFC) for integration.
- Prefer BAPIs (or released OData APIs) over direct table writes.
BAPIs today
BAPIs remain widely used, but for cloud and modern integration, released OData APIs are increasingly preferred. Still, understanding BAPIs is essential for classic integration, data loads, and much existing custom code.
Common pitfalls
- Forgetting the commit.
- Not checking RETURN.
- Direct table writes instead of a BAPI.