Softenant guide / SAP ABAP
IDocs, BAPIs, RFC and HTTP APIs describe different parts of SAP integration. Learn what each does, how to choose an appropriate interface and how to distinguish message delivery from successful business processing.
This guide separates classic SAP integration concepts from ABAP Cloud development rules. Actual API availability, authentication, monitoring tools and transaction behaviour depend on the SAP product and release. The examples below are fictional design exercises, not production instructions.
IDoc vs BAPI vs RFC vs API
- IDoc: a structured business message with a defined segment layout and processing history. It is commonly used in asynchronous integration, where sending and business processing can occur at different times.
- BAPI: a business-oriented programming interface. Its parameters and return messages form a contract for a particular business operation.
- RFC: a mechanism for calling remote-enabled SAP function modules. A custom remote-enabled function module is not automatically a released BAPI.
- API: the broader term for a programming contract. In many integration discussions, “API” means an HTTP-based interface such as OData or SOAP, but BAPIs are APIs too.
These are not four mutually exclusive products. A BAPI can be called over RFC, and ALE can connect asynchronous IDoc processing with BAPIs. See SAP’s BAPI communication explanation. Decide the business contract and delivery requirements before selecting the mechanism.
Reading an IDoc: control, data and status
Start with three record groups. The control record identifies administrative information such as sender, receiver and message. The data records hold business content in segments. The status records describe processing history and help locate failures. SAP explains these separately in IDoc Structure: Technical Background.
A message type describes the business message; the basic type defines its technical structure. Partner configuration and processing configuration connect a message with its intended routing and application handling. An extension must be understood by the relevant participants; adding a segment in one system does not teach the receiver how to interpret it.
When troubleshooting, capture the IDoc number, current status, relevant status text, sender and receiver, message type and business reference. A hand-off to a port or middleware component is not proof that the receiving application posted the intended document. Follow the chain through to the business result.
BAPI return messages and transaction handling
A function returning normally is not enough to establish business success. Read its documentation, inspect the complete return structure or table and identify the created or changed business object. Treat error and abort messages as failures; decide warning handling from the documented business requirements.
For a BAPI following the caller-controlled transaction model, commit only when the operation and the overall logical unit of work have succeeded. Use the documented commit or rollback interface, and check its outcome. Do not add an unconditional commit after every function call or assume every historical BAPI has identical transaction behaviour. SAP documents both the general model and exceptions in its BAPI transaction guide.
As a concrete reading exercise, inspect the documentation for BAPI_GOODSMVT_CREATE: SAP describes its return messages and caller-owned transaction control in Goods Movements with BAPI. This is not permission to run inventory postings against a live system.
RFC: connection success is not business success
Synchronous RFC waits for the remote function’s result and requires the participating systems to be available for the call. Other RFC variants address different execution and delivery needs. Do not treat asynchronous RFC as a universal durable queue; verify the selected variant’s behaviour. SAP’s RFC overview describes these differences.
A successful destination connection test only narrows the problem. The execution user may still lack permission for the requested business operation, the payload may be invalid or the application may return an error. Keep connection failure, authorisation failure, application failure and uncertain outcome as separate diagnostic cases.
HTTP APIs and ABAP Cloud
For an HTTP integration, start with the specific service contract: supported operation, mandatory fields, authentication, authorisation, error response, pagination where applicable and retry behaviour. Inspect both the transport response and the documented application result. Avoid assuming that one service’s behaviour applies to every OData or SOAP endpoint.
ABAP Cloud requires attention to released APIs and allowed repository objects. An accessible classic function module is not automatically released for cloud development. Check product compatibility and the release contract before designing a dependency. SAP’s ABAP Cloud concepts explain the separation between SAP code and custom code. Continue with our clean-core guide and RAP architecture guide.
Practice scenario: a delivery confirmation arrives twice
In this fictional case, a warehouse sends a delivery confirmation with external reference TRAIN-00042. The sender times out and cannot tell whether SAP completed processing, so it attempts delivery again. The design problem is to produce one intended business effect while keeping an auditable processing history.
- Define the contract: name the supported SAP operation, business identifier, required quantities and units, and expected confirmation.
- Validate before processing: test a missing reference, an unknown business object and an invalid quantity. Return a useful error without silently filling invented values.
- Design duplicate handling: use a stable reference and the interface’s supported idempotency or reconciliation mechanism. Do not assume the transport automatically protects against a newly submitted business duplicate.
- Test an uncertain outcome: simulate a timeout after the receiver may have processed the request. Check the business result before resending a write.
- Reconcile: connect the external reference, technical message or request identifier, SAP document and final outcome in a support record.
A duplicate check followed by an unprotected write can itself race when two requests arrive together. Discuss concurrency and atomicity with the interface owner. This makes a stronger project explanation than simply saying “retry the failed message.”
A troubleshooting sequence that preserves evidence
- Confirm the source generated the intended event and retain a redacted sample.
- Trace the message through routing and middleware using its identifiers and timestamps.
- Inspect the receiving system’s application error and business reference.
- Check mapping, master data, permissions and transaction outcome against the documented contract.
- Correct the identified cause in a test environment, then follow the approved recovery process.
- Verify the business document and reconcile the sender’s final state.
Do not repeatedly reprocess messages, weaken authorisation or log passwords and tokens as a troubleshooting shortcut. Logs should retain enough correlation information to diagnose a failure without exposing unnecessary personal or business data.
Interview questions to practise
Is every RFC-enabled function a BAPI?
No. Remote enablement describes how a function can be called; a BAPI provides a defined business interface.
Does a sent IDoc prove the business document exists?
No. Trace receiving-side processing and verify the business result, not only the sender’s technical hand-off.
What should happen after a timeout?
First determine whether the outcome is known. A blind retry can create a duplicate when the first write succeeded but its response was lost.
Related SAP ABAP guides
- Data Dictionary types and relationships
- BAdIs, user exits and enhancement spots
- Smart Forms and Adobe Forms
- ABAP Objects and exception handling
Develop practical ABAP skills
Explore the syllabus and enquiry options for SAP ABAP training in Vizag and Visakhapatnam. Keep your portfolio examples clearly labelled as training work and explain the evidence behind each integration decision.