IDOC Interview IMP
IDOC Interview IMP
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.
In the SAP System, IDOCs are stored in database. Every IDOC has an
unique number (within a client).
Key Features
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
Structure of an IDOC
The Idoc structure consists of 3 parts
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
Status Record
IDOC Types
An IDOC Type (Basic) defines the structure and format of the business
document that is to be exchanged.
What is a Segment?
Definitions keep changing as per the version but the segment type
remains the same.
Transaction :WE31
An IDOC is of 2 types:-
1. Basic
2. Extension
SAP provides many a pre-defined Basic IDOC Types which cannot 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.
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.
Partner Profiles
A partner is defined as a business partner with whom you conduct
business and exchange documents
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!
The SAP system on the vendors 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.
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.
Steps Involved-
What is an IDOC?
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.
Key Features
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
Status Record
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?
Transaction :WE31
An IDOC is of 2 types:-
3. Basic
4. 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
Message Type
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
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!
Steps Involved -
9. Create segments(WE31)
10. Create an idoc type(WE30)
11. Create a message type (WE81)
12. Associate a message type to idoc type(WE82)
13. Create a port(WE21)
14. 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
15. Otherwise create the function module or stand alone program
which will create the idoc
16. 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.
Steps Involved-
==================================
IDoc Basics For Functional Consultants
ABSTRACT
OVERVIEW
IDoc is an SAP object that carries data of a business transaction from one
system to another in the form of electronic message. IDoc is an acronym
for Intermediate Document. The purpose of an IDoc is to transfer data or
information from SAP to other systems and vice versa. The transfer from
SAP to non-SAP system is done via EDI (Electronic Data Interchange)
subsystems whereas for transfer between two SAP systems, ALE is used.
For inbound flow, EDI converts partner data and IDoc is created in SAP.
After successful processing of this IDoc, Application Document is posted in
SAP.
IDoc Types are based on the EDI standards and mostly on EDIFACT
standards.
Basic Types (or IDoc Type) defines the structure of an IDoc. Each basic
type describes standard IDoc segments, format of data fields and their size.
Basic Type also defines number of segments and fields in an IDoc. All the
fields that are necessary for transmission of message for a particular
business transaction are mapped in different segments. It also defines the
structure and relationship of IDoc segments along with mandatory and
optional segments.
IDOC EXTENSION
Basic type contains all the standard fields that are necessary for carrying
out a business transaction. However, if any additional values are to be sent
to the partner then we can make use of the IDoc Extension feature. IDoc
extension is extension of basic type and contains additional custom IDoc
segments and fields that are not available in standard basic type.
IDOC SEGMENTS
IDoc segments contain the actual data that is sent to or received from a
partner. These segments contain the actual values that are sent as part of
IDoc transmission.
IDocs sent outside the system are termed as Outbound IDocs and the ones
that are received into the system, are called as Inbound IDocs.
IDOC DIRECTION
PARTNER
PARTNER TYPE
MESSAGE 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.
PROCESS CODE
The process code contains the details of the Function Module that are used
for IDoc processing. Message Type can be linked to the Process code.
PORT
IDoc Port contains the information about the way data is sent between the
source or target system. The type of port defines the information contained
within the port. For port type “Internet” Port will contain IP address of the
target system. For port type “file”, directory or file name information is
maintained. “tRFC” port contains information about the RFC destination of
the target system. For IDoc transmission using ALE “tRFC” ports are used.
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:
This involves sender/receiver port, Output mode and relation to IDoc type
i.e. Basic Type and extension.
This contains application for which IDoc will be created e.g. EF for
Purchase order, the message type of the application that will trigger the
IDoc and Process Code that will convert SAP document to an IDoc. For
example, if PO is to be sent to the Vendor AXXXXZ, then in the outbound
option of the partner AXXXXZ we need to maintain the message type ZXX1
and link it to the Process Code ME10. So when message type ZXX1 is
triggered in the PO then an IDoc will be created for the partner vendor
AXXXXZ.
In the post processing option we can maintain the workflow details of the
users or positions to which an error notification will be sent if an IDoc
processing fails.
EDI standard screen contains the details of the Standard EDI terminology
used for the IDoc transmission.
For example, Message Type 850 is an EDI standard for Purchase Order
IDoc and is linked to IDoc Message Type Orders.
STRUCTURE
IDoc structure is divided into Control Record, Data Records and Status
records.
These records are stored in the transparent tables in SAP. These are
EDIDC, EDID4 and 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.
The relationship between the IDoc and the application document can be
found in two ways:
1. Relationship tab of IDoc
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:
An inbound IDoc goes through all the above statuses in reverse order (50-
64-53).
IDOC PROCESSING
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.
REPROCESSING IDOCS
If an IDoc contains error in the data then such IDocs can be edited using
TCode WE02 or WE05. When an IDoc is edited the original IDoc
information(backup) is saved in a New IDoc under status 70 (for inbound) /
33 (for outbound). These IDoc stays in the system for reference only and
cannot be processed. The status of the edited IDoc becomes 69 (inbound)
and 32 (outbound). These IDocs can then be processed using BD87
transaction or batch jobs.
Debugging of IDocs can be done using by copying the IDocs using TCode
WE19. WE19 is a test tool for Idocs processing. WE19 copies the existing
idoc and creates a new IDoc which can then be modified as per testing
needs. The newly generated IDoc can also be processed using BD87.
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.
TCODE WE09: SEARCHING DATA IN IDOC SEGMENTS
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.
IDoc documentation can be found using TCODE WE60 and can be helpful
to obtain information of the IDoc Type or its particular segment. It also
provides information such as mandatory and optional segments, minimum
and maximum number of segments, etc.
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.
IDocs are text encoded documents with a rigid structure that are used to
exchange data between R/3 and a foreign system. Instead of calling a
program in the destination system directly, the data is first packed into
an IDoc and then sent to the receiving system, where it is analyzed and
properly processed. Therefore an IDoc data exchange is always an
asynchronous process. The significant difference between simple RFC-
calls and IDoc data exchange is the fact, that every action performed on
IDocs are protocolled by R/3 and IDocs can be reprocessed if an error
occurred in one of the message steps.
1.ABAP Development
Table Description
EDIDC Stores the Control Record information an IDOC
EDID4 Stores the Data Records (version 4.6)
EDIDD Data Seg (EDI Intermediate doc)
EDIDS Stores the Status of an IDOC
=================================================
IDocs are basically a small number of records in ASCII format,
building a logical entity. It makes sense to see an IDoc as a plain
and simple ASCII text file.
IDocs is the acronym for Interchange Document. This indicates
a set of (electronic) information which builds a logical entity.
Any IDoc consists of two sections:
Control record:
- The control record carries all the administrative
information of the IDoc, such as its origin, its destination and a
categorical description of the contents and context of the
attached IDoc data.
- The control record has a fixed pre-defined structure,
which is defined in the data dictionary as EDIDC.
Data record:
- Which contains the application dependent data, as in our
example below the material master data.
- All IDoc data records are exchanged in a fixed format,
regardless of the segment type. The segment's true structure is
stored in R/3's repository as a DDic structure of the same name
Contents of idoc:
1)Control Records
2)Data Records
3)Status Records
Creation of IDOCs
Transaction code: WE 30
Steps of Defining Segment
The two processes for IDoc are Outbound Process and Inbound
Process.
Outbound Process
When the data is sent out from the system, the process is called
Outbound Process and the IDoc is known as Outbound IDoc.
Inbound Process
====================================================
IDOC Process
1. What is Idoc?
IDocs are structured ASCII files (or a virtual equivalent). They are
the file format used by SAP R/3 to exchange data with foreign
systems.
Go to Transaction WE30
1. For new IDOC type select the radio button Basic type and
press Create button.
2. Then select the IDOC option to create and press Enter. Give
segment name, minimum and maximum number for and
save it. Check if this is mandatory segment.
3. If you want Header and Item create the segment tree
according to that, you can view as follows then press
Save.
4. Then go back and set release the IDOC type for using it
further. Idoc type will be created successfully once we
release that status. We have to release the segments (in
WE31) and IDOC type as well.
Click the node define logical system from SPRO -> SAP
Reference IMG -> SAP customizing Implementation Guide ->
SAP xApp Resource and Portfolio Management (SAP xRPM) ->
Base system Interfaces -> SAP Human Capital Management
Integration -> Common system configuration and SAP HCM ALE
setup -> Application link enabling (ALE) -> Basic Settings ->
Logical Systems -> Define Logical System
9. Select your model view -> click edit -> Add message
type
10. In dialog box specify sender, receiver, and message type and
continue.
12. It will show the following screen. Select your model view and
click on execute.
SAP XI
1) RFC Destination (SM59)
a) Choose create.
d) In the technical settings tab enter the details SAP SID/URL and
system number#.
g) In the Logon /Security tab, enter the client user & Password
details of Destination system.
e) Save
a) Create new
SAP R/3
a) Choose create.
d) In the technical settings tab enter the details SAP SID/URL and
system number#.
g) In the Logon /Security tab, enter the client user & Password
details of Destination system.
e) Save
3) Create Partner Profile (WE20)
a) Create New
b) Create the Partner no. name as same the logical system name
of the destination system.
I) save.
BS for SAP R/3 (Logical system):- Assign the client name created
in R/3 as Logical system Name.
In the menu
IDOC STEPS
They can be used for SAP to SAP and SAP to non-SAP process
communication as long as the participating processes can
understand the syntax and semantics of the data. Complete
documentation on IDOC is obtained by using transaction WE60.
Every IDoc has exactly one control record along with a number of
data records and status records. Control record has the details of
sender/receiver and other control information.
The Scenario
Go to WE81
Create a new Message type ZRZSO_MT
Save the object
Go to WE82 and create new entry
Assign the message type ZRZSO_MT to the basic type
ZRZORDER
Also specify the Release Version
Save the object
Outbound Settings
SALE
Click on Change
Create a new model view
Provide a Short text and Technical name to the model view
Add message type
Specify sender and receiver systems
Also, specify the message type that we created previously
Save the Distribution model
Inbound Settings
WE02
Thus to summarize we have learned how to: