RFC, BAPI, IDoc and SOAP Integration
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
Companies rarely run one SAP system alone. The expense claims that employees enter in one system must reach the accounting system, a payroll provider wants the approved amounts, and a partner’s web shop wants to read business partners. SAP has offered several "doors" for this over the years, and many of them are still in daily use in SAP S/4HANA on premise and in other systems built on the ABAP Platform. This page looks at four of them from the point of view of the person who must connect two systems and keep the connection running, not of the person who writes the ABAP code: the remote function call (RFC) with its destinations, the BAPI, ALE with IDocs, and SOAP web services. For each door it names what has to be set up, in which transaction or tool, and what you look at when something goes wrong. The page is written for the ABAP Platform documentation of release 2025 FPS02 (October 2026), which covers classic ABAP and on-premise systems. It says for each part what is different in ABAP Cloud, the restricted ABAP language of SAP BTP and SAP S/4HANA Cloud Public Edition. The ABAP code that sits behind these doors is on RFCs, BAPIs and IDocs; this page points to it and does not repeat it. Every listing on this page needs an SAP system and is not run here.
Before you read
-
RFCs, BAPIs and IDocs: the ABAP view of the same topic, with the code of RFC calls, BAPI calls and IDoc processing.
-
Clients and the System Landscape: why there are development, test and production systems, and so a destination or port per system.
-
Security and Operations: users, least privilege and encryption, which every connection on this page depends on.
-
OData and SAP Gateway: the newer web-style door, for comparison at the end.
Key terms
-
Remote Function Call (RFC): a call of a function module in another system through the RFC interface.
-
RFC destination: a named entry, kept with transaction SM59, that stores where a call goes and how to log on.
-
BAPI: a standard, RFC-capable function module that is a method of an SAP business object.
-
Application Link Enabling (ALE): the technology that distributes business data between loosely coupled systems, asynchronously, mostly with IDocs.
-
IDoc: an intermediate document, the common exchange format of ALE and EDI.
-
Message type: the name of the business function an IDoc carries, such as ORDERS.
-
IDoc type: the technical structure of an IDoc, such as ORDERS01.
-
Partner profile: the settings that say which messages a partner may exchange, through which port, and how inbound messages are processed.
-
SOAP: an XML message format for web services, sent over HTTP.
-
WSDL: the XML file that describes a web service, its operations and its messages.
-
Consumer proxy: generated ABAP code that packs a call into a SOAP message and reads the answer.
-
Logical port: the runtime settings of a consumer proxy, such as the address it calls.
-
Communication arrangement: in ABAP Cloud and SAP S/4HANA Cloud, the administrator’s setup that ties a communication scenario to a communication system and its credentials.
Four doors into an SAP system
The four doors differ in who waits, in what travels and in where you configure them.
| Door | What travels | Waits for the answer? | Where you set it up (classic ABAP) |
|---|---|---|---|
RFC and BAPI |
A function module call with its parameters. A BAPI is a standardized RFC-capable function module. |
Yes for the synchronous form (sRFC), which the documentation recommends for a BAPI whose result must come back to the caller. |
An RFC destination in transaction SM59. |
ALE and IDoc |
An IDoc: a document with a control record, data records and status records. |
No. ALE sends asynchronously, so the data arrives even if the receiver is down at that moment. |
A port, a partner profile and process codes, in the transactions of the IDoc Interface/ALE menu. |
SOAP web service |
An XML message described by a WSDL file, sent over HTTP. |
Either way: calls can be synchronous or asynchronous. |
The SOA Management tool for runtime settings and the ABAP tools for the service objects. |
OData and events |
JSON or XML over HTTP, or a short event message. |
Request and answer (OData), no waiting (events). |
See OData and SAP Gateway and Business Events. |
Source: BAPI, ALE Integration Technology and Consuming a SOAP Service
The decision usually follows two questions: must the sender wait for the answer, and is the receiver an SAP system of the same generation as the sender?
The chart only organizes the choice. It does not say that one door is better than another, and the next sections show what each costs in setup.
RFC destinations and SM59
An RFC call needs to know where it goes. That information is an RFC destination, a named entry that the system administrator
creates in transaction SM59 and that a program names after DESTINATION. The documentation says that to communicate by RFC
you define the target systems as RFC destinations in the sending system. SM59 also offers general functions around the
destinations: displaying and deleting the RFC trace, maintaining trust relationships between systems (a simplified logon),
maintaining RFC groups, configuring an HTTP proxy, and utilities such as checking internal connections and testing server
groups.
Source: Maintaining Remote Destinations
Each destination has a connection type. Two of them are for HTTP: type G is a connection to an external server and type H is a connection to an ABAP system. The documentation states that the technical settings (host, port, path prefix, proxy) are the same for both and that only the available logon procedures differ. Type G offers no logon, basic authentication and an SSL client certificate. Type H adds the SAP logon procedures: the standard one, which uses the same client, language and user as in the calling system, and the trusted-system logon. For HTTPS you must enter the full host name with its domain and the correct port. The documentation also says that SAP recommends a fixed destination, because it reduces the configuration of communication parameters.
Other connection types exist for RFC itself. SAP’s help pages list type 3 for connections to an ABAP system, which asks for the host name and the system number (or a load-balanced connection through the message server), and type T for a TCP/IP connection to an external program that uses the RFC library. Which type a scenario needs is decided by the partner: an ALE link between two SAP systems uses an ABAP connection, and an external program that receives calls uses a TCP/IP one. The same help pages describe the connection types in more detail than this page does.
Source: Connection Types (an older release of the SAP help)
A destination is the first thing to check when an RFC fails: the SM59 test of the connection tells whether the target is reachable and whether the logon works, before any program is involved. The worksheet below is the information an administrator needs from the project before creating the destination of the running example, where the expense system calls the accounting system. The names are examples, not real systems.
Destination name : EXP_ACCOUNTING
Connection type : 3 (ABAP system)
Target : host and system number of the accounting system (or its message server)
Logon : technical user with the least authorization that the called module needs
Trust : none, or a trusted-system relationship if single sign-on is wanted
Used by : the expense system (CALL FUNCTION ... DESTINATION 'EXP_ACCOUNTING')
Owner : the Basis team of the accounting system
Source: Maintaining Remote Destinations (the worksheet is a planning aid written for this page, requires an SAP system; not run here)
In ABAP Cloud there is no SM59. A call goes through a communication target that a developer creates in ADT and an administrator completes; the ABAP page on RFC explains the details. From a cloud application to a system on premise the usual way is the destination of SAP BTP, described on Connectivity, Destinations and Cloud Connector.
BAPIs at the integration level
A BAPI is a method of an SAP business object, stored in the Business Object Repository (BOR) and implemented as an RFC-capable function module. SAP’s documentation says that client programs using BAPIs can be part of the same system, of an external system (the page names a .Net application as an example), of an HTTP gateway or of another SAP system. To trigger a business process in another system you usually use the synchronous form, sRFC, because the sending system wants the result back. For asynchronous communication with BAPIs, ALE is used, with additional IDoc interfaces generated for the BAPIs.
Source: BAPI
For the integrator this means two things. A BAPI needs the same RFC destination as any remote function, so its availability
depends on SM59 and on the logon data. And a BAPI that changes data is only complete after the caller has checked the
return table and committed; the code for this, with BAPI_TRANSACTION_COMMIT, is shown and explained on
RFCs, BAPIs and IDocs.
ALE and IDocs: the configuration chain
ALE integrates business processes between SAP systems and between SAP and non-SAP systems. Its systems are loosely linked:
each keeps its own database, data is exchanged asynchronously, and synchronous connections are used only to read data. The
transactions are reached from the menu Tools, IDoc Interface/ALE, and the settings are in the Implementation Guide under
Transaction SPRO, SAP Reference IMG, Application Server, IDoc Interface/ALE (or with transaction SALE). SAP also defines
user roles for the work: SAP_BC_MID_ALE_ADMIN for ALE administration, SAP_BC_MID_ALE_DEVELOPER for ALE development, and
roles for master data distribution in logistics, accounting and human resources.
Source: ALE Integration Technology
Two names describe what an IDoc carries. The message type names the business function, for example ORDERS for a purchase order. The IDoc type is the technical structure of the document, for example ORDERS01, built from segments. One message type can be sent in more than one IDoc type, and the partner profile says which combination a partner uses. The structure of an IDoc (control record, data records, status records) and its status numbers are explained on RFCs, BAPIs and IDocs.
Before the first IDoc can flow, an administrator maintains a chain of settings, each in its own transaction. The chain below is the order in which the book consulted for this page lists them for an outbound scenario.
The documentation of the IDoc Interface confirms the pieces: a port describes the technical link to the other system, a partner profile defines which messages the partner may exchange, through which port and how inbound messages are processed, and a process code in the profile decides which function module reads or writes the data. Process codes are maintained in transactions WE41 (outbound) and WE42 (inbound). Port types named in the documentation include the file interface, which most EDI subsystems use, and transactional RFC for ALE scenarios; a tRFC port relies on an SM59 destination, which is why SM59 is the first box of the chart. For the ALE part of a link between two SAP systems, the partner is a logical system. SAP help pages describe WE02 as the transaction that displays an IDoc and its status, and WE19 as the test tool, which creates a new IDoc from an existing one so that you can process it again.
Source: IDoc Interface: Configuring Ports, IDoc Interface: Defining Partners, IDoc Interface: Processing IDocs and Troubleshooting in PEO-ERP Integration (names WE02 in a troubleshooting step)
The ALE pages belong to the ABAP Platform documentation of the classic integration technology. They describe the mechanism correctly, but their menu paths come from older releases, so check each path in your system.
Message type : EXP_CLAIM (example name for the expense claim message)
IDoc type : a customer IDoc type with a header segment and one segment per item
Sender : logical system of the expense system
Receiver : logical system of the accounting system
Port (WE21) : tRFC port that points to destination EXP_ACCOUNTING
Partner profile : WE20 entry of the receiver, outbound parameter with the three names above
Process code : outbound code (WE41) that links the module writing the IDoc
Monitoring : WE02 for the status, work items for the responsible agents
Source: IDoc Interface: Defining Partners (the list is a planning aid with invented names for the running example, requires an SAP system; not run here)
When an inbound IDoc is not posted, the interface creates work items for the responsible agents, who are read from the partner profile. This is why the agent entry of the profile matters in production: an empty one means that nobody is told.
SOAP web services
A web service is a function that is described, published and called over Internet protocols. In an ABAP system the service provider publishes the service and supplies its description in the Web Service Description Language (WSDL), and the service consumer reads that description to call it. SAP’s documentation describes the access protocol as SOAP over the HTTP transport, and it says that existing BAPIs and remote-enabled function modules can be used to set up web services. So a function that is already an RFC module can become a SOAP service without being rewritten.
Source: ABAP Web Services (an older release of the SAP help)
This is what a SOAP message looks like in general. The operation name and the fields below are made up for the running example; the envelope structure is the standard one.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<ExampleSubmitClaim>
<ClaimId>0000000042</ClaimId>
<EmployeeId>E1001</EmployeeId>
<Amount currency="EUR">123.40</Amount>
</ExampleSubmitClaim>
</soap:Body>
</soap:Envelope>
Source: Simple Object Access Protocol (SOAP) 1.1 (the message is an invented example, requires an SAP system; not run here)
Provider and consumer in classic ABAP
On the consumer side the documentation describes a consumer proxy: generated ABAP code, a proxy class with data types for the parameters, that takes over the technical work of packing the call into a SOAP message and evaluating the answer. It can be generated from a service in the Enterprise Services Repository or from the WSDL of an external provider. The proxy alone does not know where to call, so the configuration adds a logical port, an SAP-specific object that holds runtime settings, for example the URL that is called. The SOA Management tool is where a consumer proxy is configured. The book consulted for this page opens it with transaction SOAMANAGER, and it also shows how a service can only be used after a runtime configuration exists, so the same tool is where an endpoint of a provider service is set up.
Source: Web Service Consumers (an older release of the SAP help)
For a problem on a web service call, the first questions are the same as for RFC: is the target address in the logical port right, is the logon data right, and is the HTTP connection allowed through the network? An administrator who finds a logical port in a test system that was copied from production must change the URL before the first call, otherwise the test system calls the production service.
SOAP in ABAP Cloud
In the ABAP environment the documentation says that you consume services by SOAP, synchronously or asynchronously, and that an administrator can monitor asynchronous calls in the SAP Fiori launchpad. Every approach starts from a service metadata file in .wsdl format, which you can get from the SAP Business Accelerator Hub or from another web service provider. The general procedure on that page has five steps, shown as a list because the order matters:
-
Create a Service Consumption Model from the WSDL file and activate it. It supplies a code snippet for an ABAP class.
-
Create an outbound service of type Web Service.
-
Create a communication scenario.
-
Add the outbound service to the communication scenario.
-
Publish the communication scenario, so that the administrator can use it in the Communication Management apps.
The administrator then creates a communication arrangement from the published scenario, and the developer uses the generated snippet to make the call. The page names four ways to get the connection data into the call: a logical port (the way the page recommends), a communication arrangement, the destination service of SAP BTP (not available in the ABAP environment of SAP S/4HANA Cloud Public Edition), and a plain URL given in code. It also lists released protocols that adjust parts of a request: a protocol for custom SOAP header elements, one for HTTP headers, and a web service sequence protocol that enables exactly-once-in-order processing.
Source: Consuming a SOAP Service
Where older books are outdated
The book consulted for this page is Complete ABAP (first edition, Rheinwerk Publishing; the current edition is on the publisher’s page). Its chapter on interfaces teaches the same four doors, and the settings it shows still describe how a classic system is configured. Compared with today’s documentation:
-
It lists the IDoc configuration chain with SM59, WE21, WE20, WE41, WE42 and BD51, and it shows every step as a screen of an SAP GUI system. That chain is the classic one. The ABAP Cloud page for SOAP above sets up a connection with a communication scenario and a communication arrangement instead, and the page on RFC calls in ABAP Cloud names a communication target in place of an SM59 entry.
-
It teaches web services by activating the SOAP runtime nodes in transaction SICF, creating the service with the Enterprise Services wizard and configuring it with the "Simplified Web Service Configuration" of SOAMANAGER. Those screens come from older releases; check them against your system before following the click path.
-
It introduces UDDI as the registry in which services are found. The current ABAP Cloud procedure starts from a WSDL file that you obtain from the SAP Business Accelerator Hub or from the provider, not from a registry.
-
It shows no service consumption model, no outbound service and no communication scenario, because those objects belong to the ABAP environment.
-
Older books present IDoc and ALE as the way to distribute data. SAP still documents the technology for classic and on-premise systems, but new scenarios in the cloud use business events and released APIs; see Business Events.
Source: Consuming a SOAP Service and ALE Integration Technology
What to use today
A new interface between two systems is easiest to keep running when it uses the newest door that both ends support.
-
For a web-style client or a new SAP Fiori app, use OData; see OData and SAP Gateway.
-
For "this happened" notifications, use events; see Business Events.
-
For many systems and formats with mapping and monitoring in the cloud, look at SAP Integration Suite; see Integration Suite and Business Accelerator Hub, and for the front door to your APIs see API Management.
-
Keep RFC, BAPI, IDoc and SOAP where the partner system already offers only them, which is common for existing on-premise systems.
Summary
-
An RFC call needs a destination; SM59 holds destinations in classic ABAP, with HTTP types G and H and RFC types such as 3 and T. ABAP Cloud uses communication targets and communication arrangements instead.
-
A BAPI is an RFC-capable function module of a business object. It is used synchronously through an RFC destination, and asynchronously through ALE with generated IDoc interfaces.
-
ALE sends IDocs asynchronously. The chain of settings is a destination (SM59), a port (WE21), a partner profile (WE20) and process codes (WE41 or WE42); WE02 shows the result and WE19 helps to test.
-
A SOAP service is described by a WSDL file. Classic ABAP uses a service definition, a consumer proxy and a logical port configured in SOA Management; ABAP Cloud uses a Service Consumption Model, an outbound service and a communication scenario.
-
Prefer OData and events for new interfaces, and keep the older doors where the partner needs them.