Sie sind auf Seite 1von 2

What is an SAP 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 occurrence 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. 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) 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.

Das könnte Ihnen auch gefallen