Problem solve Get help with specific problems with your technologies, process and projects.

Determining which interface method to use when interfacing to SAP/R3

How do you determine which interface method to use when interfacing to SAP/R3? In other words, do you go with BAPI, IDocs, RFC or ALE and so on?

RFC is the technology that allows to call a function module within an R/3 system from another R/3 instance or an external program from an R/3 instance.

BAPI function modules are special function modules that are released by SAP as an official application programming interface, which is releases and supported for public use. Hence, BAPIs are a subset of the RFC enabled function modules. Technically, there is no difference between RFCs and BAPIs, but SAP wants you to use a BAPI to access R/3 functionality from external programs, whenever a BAPI exists.

IDoc is a transport vehicle for data transfer in and out of an R/3 system. The data transferred between the system in the IDoc format, which is a text format. The IDoc is either exchanged via a file, so R/3 writes the IDoc to a file and the other one picks up the IDoc and vice versa or the IDoc is handed other via an R/3 RFC call. To send an IDoc to R/3 you call the special BAPI function: IDOC_INBOUBD_ASYNCHRONOUS and to send it out, R/3 ultimately calls IDOC_SEND. (However, for sending you should customize the route in transaction menu WEDI, and let the IDoc engine do the work).

ALE is a scheduling mechanism that defines a scenario to determine the triggers and data types to exhange with an external system. ALE uses IDocs to ecxhange the data at a given time.

So the general decision is: Would you rather use IDocs (or ALE) or RFCs (or BAPIs) to exchange the data? If you need the data to be protocolled or to be exchanged asynchronously, then you need IDocs. If you can dispose of logging the data in the receiving system (and thus dispose of the possibility to reprocess the data), then you can call the handling RFC function directly, which is quicker, produces less data garbage, but requires that the sending system must care for the error handling.

Dig Deeper on SAP selection and implementation