RFC vs BAPI in SAP: Protocol, Function Modules and Business APIs
RFC is SAP's remote-call technology and an RFC-enabled function module is a callable technical interface. A BAPI is a business-level API method designed around a SAP business object and historically implemented as a remote-enabled function module with stable interface rules. Therefore every classic BAPI uses RFC technology for remote invocation, but most RFC-enabled function modules are not BAPIs and may be internal or unreleased.
Practitioner technical guide to RFC vs BAPI in SAP: Protocol, Function Modules and Business APIs, with architecture context, a worked example, decision rules, production pitfalls, S/4HANA implications, ownership, and the standard SAP objects used to prove behavior.
Reviewed by an ERPClimb SAP consultant on 20 Sept 2026· 815 words
What it is
Remote Function Call defines how ABAP systems and external programs invoke remote-enabled function modules, transfer typed parameters, handle communication/system failures, and support synchronous or transactional variants. BAPIs add an application contract on top: named business object/method semantics, standardized RETURN handling, documented transaction behavior, and a stability/release expectation for external consumption. A custom Z RFC can be perfectly valid for an internal landscape but it does not become a BAPI merely because it starts with a certain name or is remotely enabled. Conversely, a BAPI's underlying technical implementation is still an RFC-capable function module in classic systems.
When to use it
Choose a released BAPI when SAP provides one that matches the required business operation and the target landscape still supports BAPI/RFC integration. Use a custom RFC only when no appropriate released API exists and the organization accepts ownership of the custom contract. For new S/4HANA clean-core integrations, first evaluate released OData/SOAP/event APIs and communication scenarios; a classic BAPI may still be right, but existence in SE37 is not enough. Use RFC for technical/admin operations only when the called interface is intentionally remote-enabled and authorized.
How it fits the stack
RFC destinations in SM59 supply connectivity and authentication. BAPIs often require BAPI_TRANSACTION_COMMIT/ROLLBACK because the business LUW is controlled by the remote caller. tRFC/qRFC/bgRFC add reliability/ordering patterns, while a normal BAPI call is usually synchronous RFC unless wrapped differently. Integration Suite can call RFC/BAPI through supported adapters/connectivity, but the business semantics still come from the BAPI or custom function. Authorization checks run in the target system under the RFC user/principal.
A worked example
An external procurement app needs to create purchase orders. The backend contains many remote-enabled function modules that standard SAP itself uses, plus BAPI_PO_CREATE1 and a released REST API. Calling an internal remote FM may work in development but ties the integration to an implementation detail. The team compares the released API and BAPI based on functional coverage. If it chooses the BAPI, it handles RETURN fully and commits explicitly. SM59 connectivity is infrastructure; it does not define the business API contract.
How to choose
- Separate 'how the call travels' (RFC) from 'what business contract is exposed' (BAPI/API).
- Prefer released business APIs over arbitrary remote-enabled internal function modules.
- For new S/4HANA integrations, check the current released API catalog before defaulting to classic BAPI.
- If building a custom RFC, version and document it like an external API because your team owns backward compatibility.
- Design authorization and technical-user/principal propagation independently from interface selection.
Common pitfalls
- Calling any RFC-enabled SAP standard function remotely and assuming it is supported for customer integration.
- Calling a write BAPI and forgetting the required BAPI transaction commit/rollback pattern.
- Treating SM59 connection success as proof that business authorization/data are correct.
- Building a custom RFC with unstable table/structure types that change every release.
- Using one shared powerful RFC user instead of least-privilege or propagated identity where appropriate.
ECC, S/4HANA and clean core
Classic RFC/BAPI remains available in S/4HANA on-premise/private cloud and is still widely used. SAP's clean-core direction favors released APIs and contracts, and ABAP Cloud cannot freely call unreleased function modules. Side-by-side extensions should select the released interface with the best semantic fit; that may be OData, SOAP, event, IDoc or BAPI depending on the scenario.
Whose problem this is
Integration architects choose the contract; ABAP teams own custom RFCs/wrappers and BAPI handling; Basis owns SM59/connectivity; Security owns authentication/authorizations; functional teams validate that the chosen BAPI/API actually implements the required business semantics.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-technical-topics/rfc-versus-bapi-in-sapERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.