IDOC

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

IDOC

What is an IDOC ?
IDocs refers to Intermediate Documents in sap.IDoc can be described as an
intermediary document, which is used for the transfer of information between SAP to
an SAP system, as well as from SAP to a non-SAP SAP system via either ALE or
EDI technologies. In another way, IDoc is like a box or data container, inside which
you can place any type of information or data, and SAP will then send the box to a
different system, which might be SAP or non-SAP.

Structure of an IDOC
You can view an I-DOC using transaction WE02 or WE05

The data is stored in the transparent tables of SAP. They are. EDIDC, EDID4,
EDIDS.

IDocs are stored internally in a persistent manner in the database in SAP,


whereby the following tables are filled:

 EDIDC
Contains one Control Record per IDoc with one unique IDoc number.
 EDID4
Contains one or more Data Records. The reference to the Control Record is
done via the unique IDoc number.
 EDIDS
Contains one or more Status Records. The reference to the Control Record is
done via the unique IDoc number.

The Idoc structure consists of 3 parts :

Created 18/01/2022
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.

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

Created 18/01/2022
 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

What is IDOC Types :


 WE82 - Message Type and IDoc Type
 You can define IDOC types using WE30

IDoc Types is based upon EDI standards that are provided by SAP. It is based on the
foundation of EDIFACT standards.
The Basic types (or IDoc Type) define the structure of an IDoc. Each basic type
defines the basic IDoc segments, the format of data fields, and the size.
The basic type also defines. Extensions are determined by the client and are paired
with a basic type to create an entirely new IDoc type.Example ,for Material Master-
MATMAS ,Customer Master- DEBMAS

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

Created 18/01/2022
What is a Segment ( T-code : WE31)
IDoc segments are the real information sent to or received by the partner. They contain
the exact data that is sent as part of an IDoc transmission..

Parent and Child Segments:


IDoc segment is termed as parent segment if it contains its own segments. These
dependent segments are called as child segments

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.

Documentation(T-code : WE60)

Created 18/01/2022
Each IDOC are thoroughly documented in transaction 

Message Type (T-code : WE81)


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.

IDoc processing entails sending or receiving documents as messages, each


corresponding to SAP records. These documents include order, Shipment
Confirmation, Advance Shipping Notification, good receipt, or invoice. The type of
data or document exchanged with the partner is determined by the message type,
which is connected to Basic IDoc Type (Basic Type).
IDoc processing involves transmission or receipt of document in the form of a
message, each of which represents a document in SAP. These documents can
be Order, Shipment Confirmation, Advance Shipping Notification, Goods
Receipt, or Invoice.  Message type is associated with Basic IDoc Type (Basic
Type) and defines the kind of data or document that is exchanged with the
partner.

What is Process Code


Process code is information regarding the Function Module, which is used in IDoc
process.

The type of message may be linked directly to the process code.

What is Port
IDoc Port contains information about how data is transmitted between the target and
source system. The type of port is what defines the data contained in the port. For the
type of port “Internet” Port will contain the IP address of the target system. When port
types are “file”, directory or name information for files is kept. “tRFC” port contains
information regarding how to reach the RFC location of the system to be targeted. To
support IDoc transmission , ALE “tRFC” ports are used.

Created 18/01/2022
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.

- For 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.

Partner : (T-code : WE20)


The Business Partner will be the one through whom the exchange of data will occur
using IDoc. It could be a vendor or customer or some other type of system. Based on
the direction of information that is transmitted, it can play the function of a “sending
partner” or a “receiving partner.”

Partner profile must be maintained for all the business partners to whom we
want to send or receive the IDocs. The TCODE for maintaining the partner
profile is WE20.

Double clicking on the Partner will show the following screen:

Created 18/01/2022
Partner profile contains parameters for Inbound and Outbound processing of
IDocs. For each message type we can maintain, inbound/outbound options,
message control, post processing options and contact information within
Inbound and outbound parameters.
PARTNER TYPE
Partner type/role is used to identify partners within the sap systems. Partner type
is KU for customer, LI for vendor and LS for Logical System.

SAP EDI /IDOC Step by step Set up


 Create and assign a logical system to a client
 Activate the SAP Workflow
 Activate event-receiver linkage
 Set up an IDoc administrator
 Define a port
 Define user-specific parameters

Created 18/01/2022
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
with.Trigger 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)

Created 18/01/2022
7. Defining process code (Transaction WE42)
8. Creation of partner profile (Transaction WE20)

Creation of IDoc Type (T-code : WE30)


Creation of new IDoc type for e,g INVOIC02 , represent an invoice that needs to be sent to
the customer electronically, As per the SAP recommendation, Any custom development
should be started with Z hence we will create new IDOC Type as ZINVOICE .you can make
your own naming.
Create IDoc type we need to follow these steps

 Create IDoc Type( T-code : WE30)


 Go to transaction code WE30
 Enter the name of the object, select the Basic type, and click the Create
icon
 Select a new option to create and enter a description for your basic IDoc
type and press Enter.
 Pick the name of the IDoc, and then press create an icon
 The system prompts you to enter à type of segment and its attributes.
 Choose the values you want and press Enter
 The system will transfer the name of the segment type to the IDoc editor.
 Follow these steps to add more segments to the parent or parent-child
relationship.
 Save it and go back
 Go to Edit -> Set release
 Creation of IDoc Segment(T-code : WE31)

Creation of IDOC segment type we need to follow the below steps

 Go to the WE31 transaction code


 Enter the name of your segment type and click the Create icon
 Type the short text
 Enter the names of variables and the data elements
 Save it and go back there.
 Go to Edit-> Set up the release
 Follow the same steps to create more segments

Created 18/01/2022
 Creation of IDoc Message Type ( T-code : WE81)4

Creation of IDOC Message type we need to follow the below steps

 Create type of message


 Go to the WE81 transaction code
 Change the details in Display Mode to Change Mode
 After selection, the system will send this message, “The table is cross-
client (see Help for more information).” Enter Press
 Click New Entries to create a new type of message
 Fill out the details
 Save it and go back there.

 Assign IDoc Type to the  IDOC Message Type ( T-code : WE82)


Now we need to assign IDOC type with the IDOC Message type, here we need to
assign Idoc type with the basis message type

 Assign FM(Function Module) to IDoc Type and Message


Type(T-code : WE57)
Follow the below steps for assignment:

 Go to the WE57 transaction code

Created 18/01/2022
 Change the details in Display Mode to Change Mode
 After selection, the system will send this message, “The table is cross-
client (see Help for more information).” Enter Press
 Click New Entries to create a new type of message
 Fill out the details
 Save it and go back there.

 Define Inbound FM Characteristics(T-code : BD51)


 Take transaction code BD51
 Change the details in Display Mode to Change Mode
 After selection, the system will send this message, “The table is cross-
client (see Help for more information).” Enter Press
 Click New Entries to create a new type of message
 Fill out the details
 Save it and go back there.

 Create Outbound process code ( T-code : WE41)


The process code contains details of the function module used for IDoc processing.
We can link the message type to the process code.

Follow these steps:


 Go to the WE41 transaction code
 Change the details in Display Mode to Change Mode
 After selection, the system will send this message, “The table is cross-
client (see Help for more information).” Press Enter, please.
 Click the New Entries button to create a new outbound process code.
 Fill out the details
 Save it and go back there.

 Create Inbound process code (T-code : WE42)


Follow these steps:
Created 18/01/2022
 Go to the WE42 transaction code
 Change the details in Display Mode to Change Mode
 After selection, the system will send this message, “The table is cross-
client (see Help for more information).” Press Enter, please.
 Click the New Entries button to create a new Inbound process code.
 Fill in details
 Save it and go back there.

STATUS RECORDS (EDIDS)


IDoc Status defines the processing status of the IDoc. IDoc statuses are used to
track the IDoc and its various processing states. Status Numbers represents IDoc
status. Current status of the IDoc is present in Control record.

Initial Status numbers are 64 for inbound and 03 for outbound. Successful status
is 53 for inbound and 16 for outbound IDocs.

TRIGGERING AN OUTBOUND IDOC


Outbound IDocs can be triggered from the output message types of Purchase Orders,
deliveries, Material Documents, invoices, etc. The following figure shows that once the
output ZXX1 of PO XXXXXXX1 is processed an IDoc “000000XXXXXXXXX1” is
added/created.

Created 18/01/2022
The relationship between the IDoc and the application document can be found in
two ways:
 Relationship tab of IDoc

 Relationship tab of Application Document, e.g. PO, SO, Material


Document, etc.

The initial status of this IDoc will be 30, which after successful processing will
convert into status 16.

Created 18/01/2022
A successful outbound IDoc will pass through all the above statuses in reverse
order (01-03-18-06-12-16). Each status represents an IDoc validation step. If an
IDoc passes all the validations it would reach status 16. These different
validation steps for outbound IDocs are explained below:
01: IDoc generation successful
30: IDoc is ready to be processed by IDoc Processing job
03: IDoc data is passed to the Port
18: IDoc successfully triggered EDI subsystem
06: IDoc data translated to EDI format
12: IDoc is dispatched successfully to the partner
16: Partner has received the IDoc successfully
IDoc can possibly fail at any of the above steps during validation.

RECEIVING AN INBOUND IDOC


The initial status of an inbound IDoc is 64 and successful status is 53.
Different validation steps for inbound IDocs are explained below:
50: IDoc received successfully in the system
64: IDoc is ready to be processed by IDoc processing job
53: Application document created and saved successfully. The document
number can be found by expanding the status node 53

An inbound IDoc goes through all the above statuses in reverse order (50-64-
53).

IDOC PROCESSING
Created 18/01/2022
 AUTOMATIC/IMMEDIATE PROCESSING
In this case, IDoc are processed immediately as they generated or added in the
system. The check “Transfer IDoc immediately” is selected in Outbound
Options and “Trigger Immediately” is selected in Inbound Option. These checks
are generally used when the real time information exchange is necessary
between two systems.

 MANUAL PROCESSING
IDocs can also be manually processed using the TCODE BD87 in SAP.
 PROCESSING VIA BACKGROUND JOB
IDoc processing by background is the most preferred way of processing the
IDocs. Following Programs are used from processing the IDocs using
background job:
RBDAPP01 – Inbound IDocs
RSEOUT00 – Outbound IDocs

REPROCESSING IDOCS
On the basis of IDoc statuses different programs can be used for reprocessing of
failed IDocs. These are given below:

Created 18/01/2022
SEARCHING IDOCS IN SAP

GENERAL SEARCH (T-CODE WE02/WE05)


IDocs can be displayed in system via TCODE WE02 and WE05. If IDoc number is not
known then  search can be made on the basis of IDoc Date, Direction, BASIC TYPE,
MESSAGE TYPE, and PARTNER NUMBER. Partner number can  be found in the Output
Messages of the documents.

IDoc search can also be made on the basis of ISA or Transfer file Reference.

SEARCHING DATA IN IDOC SEGMENTS (T-CODE WE09)


If we are looking for specific information within the IDocs Segments then this
can be found using TCODE WE09. This is useful if you are searching for a
particular information in similar kind of IDoc within IDoc segments. For
example, if you want to search a particular Purchase Order number e.g.
100000001 in multiple IDocs which lies in Segment E1EDK01 of an IDoc under
field BELNR. Then the search can be executed in the following manner.

Created 18/01/2022
GENERAL INFORMATION FOR COMMON IDOC
MESSAGE TYPES
The following list gives the Basic Type and Message Type combination for
common idocs

ARCHIVING/DELETION OF IDOCS FROM


DATABASE
As IDocs grow older they are archived and deleted from the database. Archived IDocs can be
viewed using TCODE SARI in Achieve Explorer using archiving object as IDoc. Following
are the few programs that are used for archiving and deletion of IDocs from database.
                                                                                           

To test the newly created custom iDoc type, use


transaction we19 and select test using ‘Basic Type’.
Fill data to the iDoc segment by double-clicking on each segment and executing the
iDoc using ‘Inbound Function Module’ option.

Check the status of the iDoc created in we02 or we05.

Created 18/01/2022
Created 18/01/2022

You might also like