What is the difference between a BAPI, a remote-enabled function module and BDC, and which would you pick to create a document from another system?
Say your answer out loud first.
Practise another way
A remote-enabled function module is any function module callable through RFC. A BAPI is one with a stable, documented contract for a business object: it returns messages in a RETURN table, never commits itself, and must be followed by BAPI_TRANSACTION_COMMIT.
BDC replays screens through CALL TRANSACTION or a batch input session, so it breaks when screens change. For integration I choose a BAPI or a released API first, BDC only as a last resort.
Remote-enabled function module. A function module flagged for RFC. Anyone can write one; SAP promises nothing about its interface. A synchronous RFC triggers a database commit in the calling program (except during update processing), so mind your LUW.
BAPI. A remote-enabled function module that implements a method of a business object type (BOR). SAP's programming guidelines set rules:
- The BAPI must not call COMMIT WORK, CALL TRANSACTION or SUBMIT.
- Changes go through update function modules.
- Every BAPI has a RETURN parameter for messages, not screen output or dumps.
- The interface is stable, so callers survive upgrades.
The caller therefore checks RETURN for E or A messages, then calls BAPI_TRANSACTION_COMMIT (or BAPI_TRANSACTION_ROLLBACK).
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING order_header_in = ls_head
TABLES return = lt_ret order_items_in = lt_items order_partners = lt_part.
IF line_exists( lt_ret[ type = 'E' ] ) OR line_exists( lt_ret[ type = 'A' ] ).
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = abap_true.
ENDIF.
BDC (batch data communication). You build a table of screen and field entries and replay a transaction. Two methods:
CALL TRANSACTION ta USING bdc_tab MODE ... UPDATE ... MESSAGES INTO msgtab: runs at once, in its own SAP LUW, returns messages.- Session method: you create a batch input session (SM35) that runs later and can be reprocessed after errors.
BDC depends on screen layout and fields, so any screen change or enhancement breaks it. Also, CALL TRANSACTION and batch input are not available in ABAP Cloud.
What I pick. Order: released OData or SOAP API (API Business Hub), a BAPI if no API exists, my own RAP business object for new objects. BDC only for one-off legacy loads where nothing else exists.
Neighbours. IDoc is asynchronous messaging, usually with ALE. BAdI is not a BAPI: a BAdI is a hook for your code, a BAPI is an interface to call.
Contrasts the contracts (BAPI stable and returns RETURN, RFC FM unstable, BDC screen-bound), states that the caller commits, and prefers released APIs.
Says a BAPI is just an RFC function module or recommends BDC because it is quick, with no mention of fragility or the commit.
Calling a BAPI and forgetting the commit, or committing without reading RETURN. The success message then hides a document that was never saved.
- Why must you call BAPI_TRANSACTION_COMMIT yourself?
- What is the difference between CALL TRANSACTION and the session method?
- How do you find the BAPI for a business requirement?
- What is the modern alternative for calling S/4HANA from outside?
3 official pages and 8 prep guides. Confidence: high. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.