Friday, 3 June 2016

IDOC

What is an IDOC?

IDOC is simply a data container used to exchange information between any two processes that can understand the syntax and semantics of the data.

In other words ,an IDOC is like a data file with a specified format which is exchanged between 2 systems which know how to interpret that data.

IDOC stands for " Intermediate Document"

When we execute an outbound ALE or EDI Process, an IDOC is created.

In the SAP System, IDOCs are stored in database.Every IDOC has an unique number(within a client).

Key Features
  • IDOCs are independent of the sending and receiving systems.(SAP-to-SAP as well as Non-SAP)
  • IDOCs are based on EDI standards, ANSI ASC X12 and EDIFACT. In case of any conflict in data size, it adopts one with greater length.
  • IDOCs are independent of the direction of data exchange e.g. ORDERS01 : Purchasing module : Inbound and Outbound
  • IDOCs can be viewed in a text editor. Data is stored in character format instead of binary format.

Structure of an IDOC

idoc-structure
The Idoc structure consists of 3 parts -
  1. The administration part(Control Record)- which has the type of idoc,message type, the current status, the sender, receiver etc. This is referred to as the Control record.
  2. The application data (Data Record) - Which contains the data . These are called the data records/segments.
  3. The Status information (Status Record)- These give you information about the various stages the idoc has passed through.
You can view an IDOC using transaction WE02 or WE05
SAP-IDOC 
As seen in screenshot above IDOC record has three parts Control , Data and Status. Lets look into them in detail - Control Record
  • All control record data is stored in EDIDC table. The key to this table is the IDOC Number
  • It contains information like IDOC number, the direction(inbound/outbound),  sender, recipient information, channel it is using, which port it is using etc.
  • Direction '1' indicates outbound, '2' indicates inbound.
Data Record
  • Data record contains application data like employee header info, weekly details, client details etc
  • All data record data is stored in EDID2 to EDID4 tables and EDIDD is a structure where you can see its components.
  • It contains data like the idoc number, name and number of the segment in the idoc, the hierarchy and the data
  • The actual data is stored as a string in a field called SDATA, which is a 1000 char long field.
Status Record
  • Status record are attached to an IDOC at every milestone or when it encounter errors.
  • All status record data is stored in EDIDS table.
  • Statuses 1-42 are for outbound while 50-75 for inbound

IDOC Types

An IDOC Type (Basic) defines the structure and format of the business document that is to be exchanged. An IDOC is an instance of an IDOC Type , just like the concept of variables and variables types in programming languages. You can define IDOC types using WE30
 

What is a Segment?

Segment defines the format and structure of a data record in IDOC. Segments are reusable components.

For each segment SAP creates
  • Segment Type (version independent)
  • Segment Definition (version dependent)
  • Segment Documentation
The last 3 characters is the version of the segment

Definitions keep changing as per the version but the segment type remains the same.

Transaction :WE31
SAP-IDOC 

2 comments:

  1. My friend Suggest me this blog and I can say this is the best blog to get the best knowledge.Thank you so much for this SAP Basis Training in Chennai blog

    ReplyDelete
  2. Thanks for the great information, was looking for this information from long.Great blogSAP MM Training in Chennai

    ReplyDelete