SAP how-to guides · LessonBy Anitha M, SAP Trainer, 13 yrs · Published · Updated · SAP S/4HANA 2023 · all levels
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.
Quick answer
Most integration uses existing BAPIs, prefer them over direct table writes.
Key takeaways
- 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).
- 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.
Practice challenge
+0 XPStreak ×0
Question 1 of 3
Which statement is true of Create BAPI?