The IDoc is an SAP object used to send transactional data electronically between different systems. IDoc stands for Intermediate Document. An IDoc is a standardized data structure used for transferring data between SAP systems and external systems. The transfer from a SAP to a non-SAP system is achieved through Electronic Data Interchange (EDI) subsystems, while the interchange between two SAP systems uses ALE.
iDocs can be initiated in the SAP system or EDI environment. The direction of an IDoc determines whether it is Inbound or Outbound, respectively. When sending data from SAP, IDoc documents are triggered by message control and then routed to the EDI subsystem. Electronic Data Interchange (EDI) takes the data from IDoc and transforms it into XML or a similar file format, then sends it via the Internet to a partner system.
EDI transforms partner data to generate IDocs in SAP for incoming processes. Once the IDoc is processed successfully, an application document will be posted in SAP.
![](../upload/photos/2023/04/4yy1TPn7Ziz3mFYchjeh_26_0bf7c48ae6e147f4f272686b0a54ae9b_image.png)
Figure 1 IDoc Processing Overview
EDI (Electronic Data Interchange) is a method of sending business documents between the computer systems of trading partners, using standardized formats and communication networks. EDI stands for Electronic Data Interchange.
Electronic information is commonly transmitted using either ANSI ASC X12 or EDIFACT standards. The ANSI ASC X12 committee is composed of representatives from major organizations, government bodies, and EDI software companies who create standards and guidelines for EDI data interchange. The UN/EDIFACT was created in 1985 and is an acronym for United Nations EDI for Administration, commerce and Transport, which builds on ANSI X12 and UNTDI (United Nations Trade Data interchange) as base standards. ANSI X12 outlines business documents as transactions that are represented by three-digit numbers, like 850 for Purchase Orders and 855 for Purchase Order Acknowledgements. The EDIFACT standard assigns common names, such as ORDERS, to business documents used in message transactions like purchase orders.
Terms used in IDOC
IDocs are based on EDI (Electronic Data Interchange) and EDIFACT (Electronic Data Interchange for Administration, Commerce, and Transport) standards.
IDoc Types
IDoc Types (also referred to as Basic Types) define the structure of an IDoc. The basic types of IDocs define the different segments, data fields and sizes. An IDoc's number of segments and fields is defined by Basic Type. Data fields critical for transmitting a message regarding a business transaction are mapped into different segments. In addition, it outlines the IDoc segments, their mandatory and optional properties, and how they link together.
![](../upload/photos/2023/04/VQJCLhlp1JBpLcp9ynG8_26_bc9c8fc4cb06967131de8c329e8fc14f_image.png)
Figure 2 IDoc Types
IDoc Extension
The standard fields needed to conduct a business transaction are included in the Basic type. If we need to send more information to the partner, we can take advantage of the IDoc Extension feature. An IDoc extension is a custom variation of a standard IDoc type that includes extra segments and fields not included in the standard type.
IDoc Segments
The data exchanged with a partner is contained within IDoc segments. The IDoc transmission contains specific values within these segments.
![](../upload/photos/2023/04/KUd2litXNt1mvG3zElDq_26_cb0172cb511e03b7068a09b01f7303e9_image.png)
Figure 3 IDoc Segments
Parent And Child Segments
IDoc segments that include their own sub-segments are known as parent segments. Child segments are referred to as dependent segments.
![](../upload/photos/2023/04/KDkojgtgrVGbtTnxTxhJ_26_613d05906865ee7d423be137a7dcb54c_image.png)
Figure 4 IDoc Parent And Child Segments
Idoc Direction
This term relates to how information is sent, similar to the "to" and "from" used in emails. If information is sent out of the system, it is referred to as outbox; if it is received, the direction is inbox. In SAP, Outbound direction is represented by the number "1" while Inbound direction is given a value of "2".
![](../upload/photos/2023/04/U1R9SAAe5ajTT4HltiR8_26_35f83d73dc98690416287f51d8712719_image.png)
Figure 5 IDoc Direction
Inbound/Outbound Idocs
IDocs that are sent out of the system are known as Outbound IDocs whereas those that are received into the system are known as Inbound IDocs.
![](../upload/photos/2023/04/mwDmgAIUijybHE2MzIbK_26_4c7ab8b9441dba7df4cbe1bfbfc2159e_image.png)
Figure 6 Inbound / Outbound IDocs
Partner
The partner type/role identifier is used to recognize partners in SAP systems. The partner types are KU (customer), LI (vendor), and LS (Logical System).
![](../upload/photos/2023/04/T1G3h11YIDDnXkCUGbaQ_26_f860e538581ff2f1cc8593e495170b9a_image.png)
Figure 8 IDoc Partner Types
Message Type
The IDoc Process involves sending or receiving a message in SAP that corresponds to a particular document. Order, Shipment Confirmation, Advance Shipping Notification, Goods Receipt, and Invoice are all documents that could be present. The kind of data or document that is exchanged with the partner is determined based on the Basic IDoc Type (Basic Type) and Message type.
Process Code
The process code holds the specifics of the Function Module that is used for IDoc processing. The Message Type can be linked to the Process code.
Port
IDoc Port contains instructions for the transmission of data between the source and target system. The port contains specific information depending on its type. When port type is "Internet," the port includes the target system's IP address. When using a File port, you'll store the directory name or file name data. With tRFC ports, destination details about the targeted system are kept. The transfer of IDocs through ALE requires the use of “tRFC” ports.