SAP IDOC

SAP IDOC

What is SAP IDOC?

SAP IDOC is an object that transports business transaction data in the form of an electronic message from one system to another. IDOC is an acronym for Intermediate Document. An IDOC is used to move data or information from SAP to other systems and vice versa. EDI (Electronic Data Interchange) subsystems are used to move data from SAP to non-SAP systems, and ALE is used to transfer data between SAP systems.

The SAP system or the EDI subsystem can both activate IDOC. This is referred to as Inbound IDOC or Outbound IDOC depending on the direction in which the IDOC is sent. In the case of an outbound flow, an IDOC is generated in SAP via document message control and forwarded to the EDI subsystem. EDI transforms data from IDOC to XML or a comparable format, then sends it over the Internet to a partner system.

Key features

  • IDOCs are unaffected by the sending and receiving systems. (SAP-to-SAP as well as Non-SAP).
  • A text editor can be used to view IDOCs. Instead of being saved in binary format, data is stored in character format.
  • IDOCs are based on EDI, ANSI ASC X12, and EDIFACT standards. In the event of a data size conflict, it chooses the one with the longer length.
  • IDOCs are unaffected by the direction in which data is exchanged, e.g. ORDERS01: Inbound and Outbound Purchasing Module.

SAP IDOC Structure

SAP IDOC structure consists of:

1. The administration section (Control Record) contains information such as the IDOC type, message type, current status, sender, and receiver. The Control record is what it’s called.

2. The data is stored in the application data (Data Record). The data records/segments are what they’re named

3. The status information (Status Record) tells you about the different stages that the IDOC has gone through.

An IDOC using transaction WE02 or WE05 can be viewed as

Idoc using transactions

As seen in the screenshot above IDOC record has three parts Control, Data, and Status.

Control Record

  • The EDIDC table stores all control record data. The IDOC Number is the key to this table.
  • It contains information such as the IDOC number, the direction (inbound/outbound), the sender and receiver information, the channel, and port it is utilizing, and so on.
  • Outbound is indicated by the letter ‘1,’ while inbound is indicated by the letter ‘2.’

Data Record

  • Data Records contain application data such as personnel header information, weekly details, and customer information, among other things.
  • All data records are kept in EDID2 to EDID4 tables, and EDIDD is a structure that shows how they are put together.
  • It comprises information such as the IDOC number, the name and the number of the IDOC segment, the hierarchy, and the data.
  • The actual data is kept as a string in the SDATA field, which is 1000 characters long.

Status Record

  • All status record data is stored in the EDIDS table.
  • Status record is attached to an I-DOC at every milestone or when it encounters errors.
  • Statuses 1-42 are for outbound while 50-75 are for inbound.

IDOC SAP types

IDOC types are based on EDI and, to a lesser extent, EDIFACT standards. The structure of an IDOC is defined by Basic Types (or IDOC types). Each basic type covers standard IDOC segments, as well as the format and size of data fields. The amount of segments and fields in an IDOC is likewise determined by the basic type. All of the fields required for message transmission for a certain business transaction are divided into segments. It also establishes the structure and relationships of IDOC segments, as well as mandatory and optional parts.

IDOC Segments

The actual data transferred to or received from a partner is contained in IDoc segments. The actual values that are sent as part of IDoc transmission are contained in these segments.

idoc segments

Parent and Child Segments

An IDoc segment is termed as the Parent segment if it contains its own segments. The dependent segments are called child segments.

Parent and child segments

INBOUND/OUTBOUND IDOCS

Outbound IDocs are those that are sent outside of the system, while Inbound IDocs are those that are received into the system.

IDOC Direction

This is analogous to mail terminology in that it denotes the direction in which information is conveyed. The direction is outbox if the information is transmitted outside the system, and inbox if it is received within the system. The outbox direction in SAP is represented by “1,” i.e. outbox, and the inbox direction is represented by “2,” i.e. inbox.

IDOC Direction

Partner

The Business Partner with whom you’ll be exchanging information via IDoc is known as a Partner. It could be a consumer, a vendor, or any other system. It serves the role of either a “sending partner” or a “receiving partner” depending on the direction in which the information is conveyed.

Partner

Message Type

IDoc processing entails sending or receiving documents in the form of messages, each of which corresponds to a document in SAP. Order, Shipment Confirmation, Advance Shipping Notification, Goods Receipt, or Invoice are examples of these documents. The type of data or document transmitted with the partner is defined by the message type, which is linked to the Basic IDoc Type (Basic Type).

Process Code

The process code contains information on the Function Module that is used to process IDocs. The Process code can be linked to the Message Type.