SAP Create BAPI
BAPIs provide stable, remote-enabled access to SAP business objects. This guide covers calling an existing BAPI (the common case) and notes on creating one.
Most integration calls an existing BAPI rather than creating one. Find it in the BAPI Explorer or by the BAPI_object_action naming, CALL FUNCTION it with its import structures filled, check RETURN for type E or A messages, then call BAPI_TRANSACTION_COMMIT, since most BAPIs do not commit themselves. A new BAPI means a released, remote-enabled function module on a business object.
- Watch out: model the BAPI on an existing standard one; the parameter conventions are what callers expect.
Step by step
- Find the right BAPI (BAPI Explorer, or search for BAPI_<object>_<action>).
- In ABAP, CALL FUNCTION the BAPI, filling its import structures/tables.
- Check the RETURN table for messages of type E/A (errors).
- If no errors, call
BAPI_TRANSACTION_COMMIT(most BAPIs do not commit themselves). - Handle errors/rollback as needed.
Notes and tips
Most integration uses existing BAPIs, prefer them over direct table writes. Creating a new BAPI means defining a business object method with a released, remote-enabled function module and stable parameters, a bigger task done when no suitable standard/released API exists. For cloud, prefer released OData APIs.
Common pitfalls
- Following steps without understanding the concept.
- Skipping testing in a non-production system.
- Applying blindly to a different scenario.