Escolar Documentos
Profissional Documentos
Cultura Documentos
Control record (it contains the type of IDoc, port of the partner, release of SAP R/3 which
produced the IDoc etc.)
Data records of different types. The number and type of segments is mostly fixed for each
IDoc type, but there is some flexibility (for example an SD order can have any number of items).
Status records containing messages like 'IDoc created', 'The recipient exists', 'IDoc was
successfully passed to the port', 'Could not book the invoice because...'
This transaction determines a processing code based on the partner profile identified by the control
record of the IDoc.
This transaction identifies an external port (RFC, File, ABAP-PI, etc.) that controls the IDoc flow to an
external system.
This transaction links an outbound processing code specified in a partner profile to a function module.
This transaction links an inbound processing code specified in a partner profile to a function module.
Error Handling
SAP provides a standard report (WE02) to display and edit IDocs. Unfortunately, the provided
functionality is very basic; therefore, most customers are forced to create their own custom solution.
What is an IDoc?
An IDoc Type is SAP's format for data being moved between applications. Essentially, SAP has defined what a
sales order, financial statement, invoice, etc will look like electronically. This includes how fields are grouped
together (segments), the order and hierarchy of these groupings, and the format of each individual field.
If you're familiar with EDI at all, then an IDoc will look very familiar to you. Nearly everything you're used to is
there: from segment name to allowable codes to min/max occurs.
It is important to note that an IDoc Type is really just a structure defined on the system and given a name (i.e.,
ORDERS04). An actual IDoc, however, consists of data, which fits within the defined structure of the IDoc Type.
This IDoc is identified by a number rather than by a type.
IDoc Structure
Generic Structure
Data within an IDoc is divided into three sections
1.
2.
3.
2.
1.
2.
3.
Test Flag
Other Fields
1.
2.
3.
4.
Status
5.
Receiver/Sender Port
6.
Created Timestamp
7.
Changed Timestamp
etc.
2.
3.
2.
Segment Number
3.
4.
etc
1.
2.
Counter (COUNTR)
3.
Status (STATUS)
4.
etc
Additional Considerations
1.
Data record table is version-specific. EDID4 is valid for the current release of SAP R/3 and may change
in future versions.
2.
The control record is common across all transactions and is used for routing the IDoc to the correct port
in external processing, or to the correction function module or workflow item for inbound processing.
3.
Each IDoc may have several data records, which are arranged hierarchically. The data segment table
(EDID4) contains this nesting information in the hierarchy field, etc.
4.
Each IDoc may have several status records, which are arranged in sequence.
5.
Segment Types begin with E1. This is the internal SAP format.
6.
Segment Definitions begin with E2. This is a fixed, version-specific format which defines how the outside
world sees the segment.
7.
8.
Outbound IDocs are created directly by a function module, or may be created via message control. Most
outbound documents within OTC are created by message control.
9.
Status Codes
Outbound Codes
00 Not used, only R/2
01 IDoc created
02 Error passing data to port
03 Data passed to port OK
04 Error within control information of EDI
subsystem
05 Error during translation
06 Translation OK
07 Error during syntax check
Inbound Codes
50 IDoc added
51 Error: Application document not posted
52 Application document not fully posted
53 Application document posted
54 Error during formal application check
(serialization)
17 Functional Acknowledgement negative 67 Not used
18 Triggering EDI subsystem OK
68 Error - no further processing
19 Data transfer for test OK
69 IDoc was edited
20 Error triggering EDI subsystem
70 Original of an IDoc which was edited
21 Error passing data for test
71 IDoc reloaded from archive
22 Dispatch OK, acknowledgement still due 72 Not used, only R/2
23 Error during retransmission
73 IDoc archived
24 Control information of EDI subsystem 74 IDoc was created by test transaction
OK
25 Processing despite syntax error (outbound)
26 Error during syntax check of IDoc (outbound)
27 Error in dispatch level (ALE service)
28 Not used
29 Error in ALE service
30 IDoc ready for dispatch (ALE service)
31 Error - no further processing
32 IDoc was edited
33 Original of an IDoc which was edited
34 Error in control record of IDoc
35 IDoc reloaded from archive
36 Electronic signature not performed (timeout)
37 IDoc added incorrectly
38 IDoc archived
39 IDoc is in the receiving system (ALE service)
40 Application document not created in receiving system
41 Application document created in receiving system
42 IDoc was created by test transaction
The full form of IDoc is Intermediate Document. Its a SAP standard document format for
exchanging data between different application servers. The Idoc interface will contain the data
structure and processing logic. The data structure is known as IDoc.Using IDoc different
application servers can be connection via a message based interface. It has an extensive
exception handling before the data is stored in the application server. Electronic Data
Interchange (EDI) and Application Link Enabling (ALE) are the main techniques using IDoc to
exchange data between systems.
Segments are the basic building blocks of Idoc and store the actual data. SAP supplies some
IDocs by default and they are known as basic types of idoc. We can add additional data to the
existing basic types using reference segments. We can define our own IDoc types if the basic
types wont fit for our requirements.
Structure of an IDOC
Every IDoc consist 3 records they are
Control Record: It contains the general information about that IDoc. It stores the sender
identification, receiver identification and IDoc type.Cotrol Records are stored in the data
dictionary table EDIDC and it can be views by transaction code SE11.Idoc type is the key
information for IDoc processor to interpret the data containing in that IDoc.
Important Fields containing in Control records are
Data Records: It contains the actual data to process.Data records are stored in the data
dictionary table EDIDD.Data records consists with two parts segment name and segment data.
For each segment type of the IDoc structure, there is a DDIC structure with the same name. A
field string with this structure is used for creating a data record. The application data is mapped
to the field string. The segment type is written to the field SEGNAM, and the field string is written
to the field SDATA. This data record is then included in the internal table with the structure edidd.
The fields in data records are
Status Record: It stores the status of IDOC. The status records are stored in the data
dictionary table EDIDS.
The important fields in these records are
DOCNUM
STATUS
STATXT
SEGNUM
Enter a short description of the segment and enter the corresponding field names and
data elements associated with that segment.
Enter a name for the basic IDoc type and mark basic type as the development object.
And choose create
Enter a description for the basic Idoc type and choose tick mark button.
Save
Save
Enter the message type, basic type and SAP release in their corresponding columns.
Save data
The steps for creating a function module have been described in our earlier posts. Here is a brief
about the steps.
Create the segments as global data and code the function module to pass the application
data to the corresponding segments.
Enter process code and a description. Choose the Processing with ALE and Processing
by function module options and save your entries. In the maintenance screen assign the
inbound function module to the process code.
In the detail screen enter Process code, Module fame, Idoc fame, Application Object
fame etc
Save
Go back to maintain the inbound process codes and choose the Logical message
navigation.
Save
These are the common steps involved in creating a new basic type Idoc. The other steps you
need to do after this may be
36: Timeout error on Electronic signature not performed (Its an error status)
40: Application document not created in target system (Its an error status)
57: Test IDoc: Error during application check (Its an error status)
Using the standard report RC1_IDOC_SET_STATUS we can change the status of an IDOC if we
require for that. We can reprocess IDoc if we are getting errors.
Here is the list of important ALE IDOC transaction codes and its purposes for a quick reference.
1. SALE This transaction code is used for access IMG ALE Configuration root
2. WE05 IDoc overview
3. WE07 IDoc statistics
4. WE20 This transaction code is used for manually maintain partner profiles
5. WE21 This transaction code is used for Ports in Idoc processing
6. WE47 This transaction code is used for edit IDOC status values. (Real path: SALE ->
Set-Up System Monitoring -> IDoc Status Display -> Edit IDoc Status Values)
7. WE60 This transaction code is used for create IDoc documentation (IDOC header file)
8. SM59 This transaction code is used for Create RFC Destinations
9. SM58 Schedule RFC Failures
10. BD21 Create IDocs from change pointers
11. BD50 This transaction code is used for Activate Change Pointer for Message Type
12. BD52 This transaction code is used for Activate change pointer per change.doc object
13. BD53 This transaction code is used for Reduction of Message Types
14. BD55 This transaction code is used for Defining settings for IDoc conversion
15. BD56 This transaction code is used for Maintain IDOC Segment Filters
16. BD59 This transaction code is used for Allocation object type -> IDOC type
17. BD61 This transaction code is used for Activate Change Pointers Globally
18. BD62 This transaction code is used for Define rules
19. BD64 This transaction code is used for Maintain customer distribution model
20. BD71 This transaction code is used for Distribute customer distribution model
21. BD79 This transaction code is used for Maintain rules
22. BD82 This transaction code is used for Generate Partner Profiles
23. BD87 This transaction code is used for Status Monitor for ALE Messages (Real access
path is Tools -> IDoc Interface/ALE -> Administration ->Monitoring -> IDoc Display
->Status Monitor )
24. BD88 Outbound IDoc reprocessing
25. BDM2 IDoc Trace
26. BDM5 This transaction code is used for Consistency check
Receiver determination (Receiver system for the BAPI call will define and filter objects
will check the validity of the receiver. This process take place in application layer)
Calling the generated outbound function module (Data for BAPI call and list of receiver
system are passed to the ALE outbound function module. This take place in ALE layer)
Data filtering
Conversion of BAPI calls into IDoc (IDOC containing the data is transferred and created
from the outbound function module. This take place in ALE layer)
Dispatch control (Schedule timing for the dispatch. This step also take place in ALE layer)
IDOC dispatch
In communication layer IDOCs are sent using tRFC or EDI to the target system. This step take
place in communication layer.
Inbound Processing
Field conversion
Transfer control (Decides when the BAPIs are to be called like or at a later time in
background processing.)
Conversion of IDoc into BAPI call (Data from IDOC segments will stored in the
corresponding parameters of BAPI function module)
Error handling
Report RBDMANI2
We can execute this program for manual reprocess of IDOC.It can be used when we get the
status 51 or status 63 errors for an inbound IDOC.
Report RBDMANIN
It used for Posting of inbound IDocs with Status 51.
Report RBDMOIND
It checks whether the communication with tRFC was successfully completed. If successfully
completed, the status of the IDoc is changed. This reprocess program can be used for outbound
IDOC with status codes from 03 to 12.
Report RSEOUT00
For reprocessing outbound IDOC with status 30
Report RBDAPP01
For reprocessing inbound IDOC with status 64
Report RBDAGAIN
It for reprocessing of incorrect outbound IDOC with statuses 02, 04, 05, 25 and 29
Report RBDAGAI2
It for reprocessing of IDOCs after ALE input error with statuses 56, 61, 63 and 65
Report RBDAGAIE
It for reprocessing of Edited IDOCs with status 32 and 69