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
The "only once" rule
It is valuable to note that SAP only allows one occurence of each segment type within the IDoc structure. For instance, the E1EDKA1 segment may only exist once within the IDoc type.Now, does that mean you can only have one E1EDKA1 segment in an actual IDoc? Of course not. Segments may occur multiple times if the "max occurs" setting for that segment is greater than one. This is how the E1EDKA1 segment can appear multiple times in the ORDERS04 IDoc.
This isn't a big deal if you're just using canned IDocs from SAP; but it is a useful consideration if you need to extend an existing IDoc substantially or create your own.
Generic Structure
Data within an IDoc is divided into three sections- Control Record, which contains (Table EDIDC)
- Key Fields (for inbound)
- Receiving Partner Type/ID (RCVPRT, RCVPRN)
- Logical Message Type
- Test Flag
- Other Fields
- IDoc Number (DOCNUM)
- Direction (1=Outbound; 2=Inbound)
- Sending Partner Type/ID (SNDPRT, SNDPRN)
- Status
- Receiver/Sender Port
- Created Timestamp
- Changed Timestamp
- etc.
- Key Fields (for inbound)
- Data Records (Table EDID4 in 4.6C)
- Admin Data (39 bytes)
- IDoc Number (DOCNUM)
- Segment Number
- Segment Name (SEGNAM) (e.g., E1EDK01, E1EDK03, etc)
- etc
- Actual Data (SDATA – 1,000 bytes)
- Admin Data (39 bytes)
- Status Records (Table: EDIDS)
- IDoc Number (DOCNUM)
- Counter (COUNTR)
- Status (STATUS)
- etc
Additional Considerations
- Data record table is version-specific. EDID4 is valid for the current release of SAP R/3 and may change in future versions.
- 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.
- 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.
- Each IDoc may have several status records, which are arranged in sequence.
- Segment Types begin with E1. This is the internal SAP format.
- Segment Definitions begin with E2. This is a fixed, version-specific format which defines how the outside world sees the segment.
- Segment Documentation records begin with E3.
- 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.
- The global IDoc Administrator is defined in transaction OYEA.
Status Codes
| Outbound Codes | Inbound Codes | ||
| 00 | Not used, only R/2 | 50 | IDoc added |
| 01 | IDoc created | 51 | Error: Application document not posted |
| 02 | Error passing data to port | 52 | Application document not fully posted |
| 03 | Data passed to port OK | 53 | Application document posted |
| 04 | Error within control information of EDI subsystem | 54 | Error during formal application check |
| 05 | Error during translation | 55 | Formal application check OK |
| 06 | Translation OK | 56 | IDoc with errors added |
| 07 | Error during syntax check | 57 | Test IDoc: Error during application check |
| 08 | Syntax check OK | 58 | IDoc-Copy from an R/2 connection |
| 09 | Error during interchange handling | 59 | Not used |
| 10 | Interchange handling OK | 60 | Error during syntax check of IDoc (inbound) |
| 11 | Error during dispatch | 61 | Processing despite syntax error (inbound) |
| 12 | Dispatch OK | 62 | IDoc passed to application |
| 13 | Retransmission OK | 63 | Error passing IDoc to application |
| 14 | Interchange Acknowledgement positive | 64 | IDoc ready to be transferred to application |
| 15 | Interchange Acknowledgement negative | 65 | Error in ALE service |
| 16 | Functional Acknowledgement positive | 66 | IDoc is waiting for predecessor IDoc (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 OK | 74 | IDoc was created by test transaction |
| 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 | ||
| < Prev | Next > |
|---|



