IDoc (intermediate document)
provide a standard data container structure for
SAP to exchange data between processes, such as
asynchronous EDI (electronic data interchange)
between application programs written for SAP
or between an SAP application and an external program.
IDocs is the vehicle for data transfer in
SAP's Application Link Enabling (ALE) layer.
Different types of IDoc are used for purchase orders or invoices.
In other words, an IDoc encapsulates data so that it can be exchanged between different systems
without conversion from one format to another.
Each IDoc generated exists as a self-contained text file
that can then be transmitted to a receiver (requesting workstation)
without connecting to the central database.
There are several types of IDoc records:
a single Control Record, one or many Data Records, and one or many Status record.
Segments and attributes of segments
(maximum number, hierarchical sequence, segment status, etc.)
are used for interpretating the SDATA field in the data record.
Each IDoc consists of several segments and
a unique number assigned each iDoc for tracking and future reference.
Each segment contain several fields.
IDoc data is then converted by SAP's EDI subsystem to a universal EDI standard such as
UN/EDIFACT (Electronic Data Interchange for Administration, Commerce, and Trade)
or ANSI/X12.
Business Application Programming Interface (BAPI) is used for synchronous communication method sRFC
because data usually is returned to the sending system.
BAPI methods are stored as RFC-capable function modules
in the ABAP Workbench Function Builder
accessing the SAP Business Object Repository (BOR).