ERPClimb logoERPClimb
BAPI
ABAP Developmentintermediate 8 min read

BAPI Part 3: BAPI vs RFC vs OData

Preview · a free account unlocks the full lesson

Key takeaway

Understand how BAPIs, RFC and OData relate: BAPIs as released RFC function modules, RFC as the protocol (synchronous, tRFC, qRFC, bgRFC), OData services for Fiori and REST-style integration, and how to choose the right interface for local programs, SAP-to-SAP and external integrations.

In this lessonShow sections

Visual overview

BAPI Part 3: BAPI vs RFC vs OData — learning sheetFlow: SM59: display an RFC destination and test connection → Call a BAPI remotely with DESTINATION in a test program (code example) → Look up the sales order OData API in the API Business Hub and compare its fields with BAPI_SALESORDER_CREATEFROMDAT2. Key ideas: RFC VARIANTS; BAPI OVER RFC; ODATA; HOW TO CHOOSE. Watch out: Not every RFC-enabled function module is a BAPI — unreleased RFC FMs can change without notice.ERPClimb.com / ABAP / LESSON 3/10 / LEARNING SHEETBAPI Part 3: BAPI vs RFC vs OData1 · HOW IT FLOWS1SM59display an RFC destination andtest connection2Call a BAPI remotely withDESTINATION in a testprogram (code example)3Look up the sales orderOData API in the APIBusiness Hub and compare…2 · KEY IDEAS EXPLAINEDRFC VariantssRFC (synchronous): caller waits for the result;DESTINATION in SM59.tRFC (transactional, IN BACKGROUND TASK): executedexactly once, asynchronously; order notguaranteed.BAPI Over RFCExternal systems (SAP PI/PO, middleware, Java/.NETwith SAP connectors) call BAPIs via RFC. Commitmust be called in the same RFC session…ODataSAP Gateway (SEGW) or RAP service bindings exposeentities over HTTP; used by Fiori apps and RESTconsumers.OData services in SEGW often call BAPIs in theirCREATE_ENTITY methods; RAP services use behaviourimplementations.How To ChooseInternal ABAP logic: call the BAPI directly.SAP ERP ↔ SAP ERP with guaranteed delivery andmonitoring: IDoc or qRFC/bgRFC; synchronouslookups via RFC.3 · REMEMBER · WATCH OUTRememberRFC is the communication protocol; a BAPI is a released businessmethod implemented as an RFC-enabled function module.OData is an HTTP/REST-style protocol used by Fiori and modernintegrations; OData services often call BAPIs or RAP business objects…Choose by consumer: ABAP program in the same system → call BAPIlocally; SAP-to-SAP → RFC/BAPI (or IDoc/APIs); web/mobile/cloud →…!Watch outNot every RFC-enabled functionmodule is a BAPI — unreleased RFCFMs can change without notice.4 · IN A REAL PROJECTA middleware team called BAPI_PO_CREATE1 via RFC and then BAPI_TRANSACTION_COMMIT via a separate connectionpool entry. POs were returned with numbers but never existed in SAP, because the commit ran in a different RFCsession. The integration was changed to use a stateful connection for the BAPI and commit. Later, for a new…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Parts 1 and 2 called a BAPI from inside ABAP. In integration projects, though, you also have to decide how external systems actually reach SAP in the first place — and that's where RFC, BAPIs and OData relate to one another.

RFC is the communication protocol; a BAPI is a released business method implemented as an RFC-enabled function module.

RFC itself comes in several variants. sRFC, synchronous RFC, has the caller wait for the result, using a DESTINATION defined in SM59. tRFC, transactional RFC, triggered with IN BACKGROUND TASK, executes exactly once but asynchronously, with no guarantee of ordering. qRFC is queued tRFC, which does preserve order within a given queue, monitored through SMQ1 and SMQ2. bgRFC is the newer background RFC framework that replaces tRFC and qRFC in modern releases.

Monitoring tools follow the same split: SM58 for tRFC, SMQ1/SMQ2 for queues, SBGRFCMON for bgRFC.

Calling a BAPI over RFC is exactly how external systems — SAP PI/PO, other middleware, or Java and .NET applications using SAP connectors — reach SAP in practice. The one rule that trips people up is that the commit has to happen in the same RFC session, calling BAPI_TRANSACTION_COMMIT through that same connection, otherwise nothing actually gets saved.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.