0% found this document useful (0 votes)
16 views11 pages

SAP IDOC Tutorial: Structure & Processes

SAP IDOC Tutorial_ Definition, Structure, Types, Format & Tables
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views11 pages

SAP IDOC Tutorial: Structure & Processes

SAP IDOC Tutorial_ Definition, Structure, Types, Format & Tables
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAP IDOC Tutorial: Definition, Structure, Types,

Format & Tables


By : Scott Livingston Updated March 16, 2024

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, I DOCs are stored in database. Every IDOC has a unique
number(within a client).

Table of Content:

What is an IDOC?
Structure of an IDOC
IDOC Types
What is a Segment?
What is Extension IDOC type?
Documentation
Message Type
IDOC Views
Partner Profiles
Port
This is so CONFUSING!
The Outbound Process
The Inbound Process

EXPLORE MORE

Learn Java
Programming with
Beginners Tutorial
08:32

Linux Tutorial for


Beginners: Introduction
to Linux Operating...
01:35
00:00 35:04

What is Integration
Testing Software Testing

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 a 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
The I doc 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 I-DOC using transaction WE02 or WE05


As seen the screenshot above IDOC record has three parts Control, Data and
Status. Let’s 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 is attached to an I-DOC 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 I DOC 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?
A Segment defines the format and structure of a data record in I-DOC. 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
What is Extension IDOC type?
An IDOC is of 2 types:-

1. Basic
2. Extension

SAP provides many a pre-defined Basic IDOC Types which can not be modified.
In case you want to add more data to these restricted basic type you may use an
extension type. Most of the times you will NOT use extension.
Documentation
Each IDOC are thoroughly documented in transaction WE60

Message Type
A message represents a specific type of document that is transmitted between
two partners Ex. Orders, orders responses, invoices etc

An idoc type can be associated with many message types


Also, a message type can be associated with different idoc types. Transaction
WE81

IDOC Views
An IDOC type can be used for more than one message type, which results in
IDOCs containing more fields than required for a particular message type.
IDOC views are used to improve performance in generating IDOCs to ensure only
the relevant segments are filled with data. IDOC Views are important only for
Outbound Processing.
Partner Profiles
A partner is defined as a business partner with whom you conduct business and
exchange documents

In the partner profile of a partner that we exchange Idocs with, we maintain the
parameters that are necessary for exchanging the data. The transaction used is
WE20.

Port
The port defines the technical characteristics of the connection between your
SAP system and the other system you want to transfer data with (subsystem).
The port defines the medium in which data is exchanged between the 2 systems.
There are different types of ports. The 2 most commonly used are the TRFC ports
used in ALE and File ports which EDI uses.

For TRFC ports we have to give the name of the logical destination created using
SM59.

When using file port you can specify the directory where the IDOC file should be
placed. The other system or the middleware will pick up the file from here. The
Function module can be used to generate a file name for the idoc. While Testing
you can use “Outbound file” to specify a constant file name. The tab “outbound
trigger” can be used to supply information if we want to trigger some processing
on the subsystem when an idoc is created at this location. We have to specify the
command file name and the directory which has to be run.

This is so CONFUSING!
Let’s understand the process of creating an IDOC with an example –

Whenever a Purchase Order (PO) is created we want to send the IDOC to a


vendor.
The PO is sent in the form of an IDOC to the vendor (partner). That partner
has to be EDI enabled in that system. SAP should realize that it could send
doc to this vendor electronically.
The PO sent as an outbound idoc by the customer will be inbound idoc for
the vendor. The SAP system on the vendor’s side can process this to create
an application document (a sales order) on their system.
Quotation, RFQ, PO, SO, Invoice, delivery note etc are some of the
commonly exchanged documents through IDOC

The process of data transfer out of your SAP system is called the Outbound
process, while that of data moving into you SAP system is called Inbound
process. As a developer or a consultant who will be involved in setting up theses
process for your organization. Here are the steps how to set them up-

The Outbound Process


Steps Involved –

1. Create segments(WE31)
2. Create an idoc type(WE30)
3. Create a message type (WE81)
4. Associate a message type to idoc type(WE82)
5. Create a port(WE21)
6. If you are going to use the message control method to trigger idocs then
create the function module for creating the idoc and associate the function
module to an outbound process code
7. Otherwise, create the function module or stand-alone program which will
create the idoc
8. Create a partner profile(WE20) with the necessary information in the
outbound parameters for the partner you want to exchange the idoc
[Link] the idoc.

The Inbound Process


Steps Involved-

1. Creation of basic Idoc type (Transaction WE30)


2. Creating message type (Transaction WE81)
3. Associating the Message type to basic Idoc type (Transaction WE82)
4. Create the function module for processing the idoc
5. Define the function module characteristics (BD51)
6. Allocate the inbound function module to the message type(WE57)
7. Defining process code (Transaction WE42)
8. Creation of partner profile (Transaction WE20)

Common questions

Powered by AI

IDOC views are designed to optimize performance in generating outbound IDOCs by ensuring only relevant segments needed for a specific message type are filled with data, thus reducing unnecessary data processing. They are crucial when an IDOC type is associated with multiple message types, to prevent all possible fields from being populated, which can lead to inefficiencies. This selectivity in data population minimizes load and enhances processing speeds .

Status records enhance the management and troubleshooting of IDOC processes by documenting the various stages and any issues encountered during IDOC processing. They provide a clear audit trail and visibility into the progress and flow of the data exchange, allowing users to quickly identify and address errors or delays. By being stored in the EDIDS table, status records allow for efficient troubleshooting and ensure reliable data processing in complex SAP environments .

TRFC ports (Transactional Remote Function Call ports) are used in ALE scenarios for direct, real-time communication between SAP systems, which is ideal for immediate data transfer requiring confirmation of receipt. File ports, on the other hand, are used in EDI scenarios, where IDOCs are converted to flat files and stored in a directory for another system to pickup. File ports are suitable for batch processing and cases where intermediary data storage is beneficial. Each serves different networking and data handling requirements based on the technical setup and business needs .

IDOC Types define the structure and format of the business documents for data exchange, similar to data types in programming languages. They provide a template for IDOC instances. Segments, on the other hand, represent individual data records within an IDOC and are reusable components. Each segment type is version-independent, making segments flexible and able to adapt to changing data requirements without altering the segment's identity. The combination of these structures allows for extensibility, particularly through Extension IDOC Types, which enable users to add additional segments to predefined basic types without modifying existing structures .

Configuring Outbound IDOC processing involves several critical steps: creating segments (WE31), creating an IDOC type (WE30), creating a message type (WE81), associating the message to the IDOC type (WE82), creating a port (WE21), and setting up a partner profile (WE20). These steps are crucial for defining the data structure, specifying communication parameters, and ensuring the correct routing and handling of the data involved in the outbound process. Each step builds upon the previous to ensure data accuracy, compliance with standards, and efficient communication between systems .

The relationship between message types and IDOC types is crucial for data integration as it determines how different types of business documents are structured and communicated between SAP systems. An IDOC type defines the structure, while a message type specifies the kind of document transmitted, such as orders or invoices. This relationship is significant because it ensures the proper conversion of business information into a standardized format for transmission and processing, facilitating seamless data integration and accurate communication across different systems .

An IDOC consists of three main components: the Control Record, the Data Record, and the Status Record. The Control Record contains information such as IDOC number, type, message type, sender, and recipient details and is stored in the EDIDC table. It manages the overall control flow and identification of the IDOC. The Data Record holds the application data like employee information, stored in tables EDID2 to EDID4. The Status Record provides information about the processing status of the IDOC, like errors encountered and milestones reached, and it is stored in the EDIDS table. These components interact with each other to ensure that IDOC data is accurately transferred, processed, and tracked between systems .

Extension IDOC Types are necessary when additional data needs to be sent that is not covered by the predefined Basic IDOC Types. They allow for the customization of IDOC content without altering the structure of the original IDOC type. This is particularly useful when companies have specific data exchange requirements not met by standard IDOC Types. Using Extension IDOCs ensures that these additional data requirements are met while maintaining the integrity of the data exchange process .

Partner Profiles set the parameters for data exchange between business partners in SAP, such as the message type and the associated IDOC type required for the communication. Ports specify the technical communication channel used to transmit the IDOC data between systems, such as TRFC (Transactional Remote Function Call) ports and File ports. They ensure the correct routing and processing of the IDOC in SAP and other systems by defining the medium and protocol for the data transfer .

Segment versions affect IDOC processing by dictating how IDOC data is organized based on the segment definition current at the time of communication. As segments can evolve over time, maintaining consistency relies on managing segment documentation and ensuring compatibility across systems. For example, each segment's definition can change, but segment types, being version-independent, allow the systems to recognize and process the IDOC data correctly, thereby maintaining consistency even with version changes .

You might also like