Formatting Data 

Use

The structures EDI_DC and EDI_DD are described in the following for the output. Since these structures are also used for EDI, they contain a number of fields which are redundant for our purposes.

The actual useful data is generally hidden in the field EDI_DD-SDATA. If, for example, you send two IDocs, transfer orders each with three items, you must send one EDI_DC record oer IDoc, i.e. two EDI_DC records and eight EDI_DD records, one header segment and three position segments for each IDoc. The four segments of an IDoc are bound together via the unique number of the IDoc or intermediate document. The associated EDI_DC record is also identified via the DOCNUM.

(Rel = relevant for receiving IDocs. Not relevant = indicator does not need to be set when receiving IDocs. All data, except for TABNAM, is transferred when IDocs are sent to the external system)

EDI_DD

Field

Format

Designation

Rel

Comment

TABNAM

CHAR 10

Name of table structure

 

Not relevant

MANDT

CLNT 3

Client

 

Not relevant; is transferred, however, to the external system

DOCNUM

CHAR 16

Intermediate Document number

X

Unique communication number

SEGNUM

CHAR 6

Number of the SAP segment

 

Consecutive numbering of IDoc segments; is transferred to the external system but is not required when the IDoc is received

SEGNAM

CHAR 10

Name of SAP segment

X

IDoc-Segmentname

PSGNUM

CHAR 6

Number of the higher-level SAP segment

 

Is transferred to the external system but is not mandatory for receipt of IDoc

HLEVEL

CHAR 2

Hierarchy level of SAP segment

 

Is transferred to the external system but is not mandatory for receipt of IDoc

DTINT2

CHAR 2

Blank field for EDI_DD

 

Not relevant

SDATA

LCHR 1000

Application data

X

Actual useful data in form of IDoc segments


EDI_DC

Field

Format

Designation

Rel

Comment

TABNAM

CHAR 10

Name of table structure

   

MANDT

CLNT 3

Client

   

DOCNUM

CHAR 16

Intermediate Document number

X

Unique communication number.

DOCREL

CHAR 4

SAP Release of Intermediate Document

 

Is transferred to the external system but is not required for receipt of IDoc

STATUS

CHAR 2

Status of Intermediate Document

   

DOCTYP

CHAR 8

Intermediate Document type

 

Recommended like IDocTYP

DIRECT

CHAR 1

Direction

   

RCVPOR

CHAR 10

Receiver port (SAP System, EDI external system)

 

Not relevant

RCVPRT

CHAR 2

Partner type of receiver

X

Value: "LS"

RCVPRN

CHAR 10

Partner number of receiver

X

For example: "WM_SUB_001" für SAP to SUB

RCVSAD

CHAR 21

EDI: SADR fields in total

   

RCVLAD

CHAR 70

Logical address of receiver

   

STD

CHAR 1

EDI standard

   

STDVRS

CHAR 6

Version of EDI standard

   

STDMES

CHAR 6

EDI message type

   

MESCOD

CHAR 3

Logical message variant

*

See text below

MESFCT

CHAR 3

Logical message function

*

See text below

OUTMOD

CHAR 1

Output mode

   

TEST

CHAR 1

Test option

   

SNDPOR

CHAR 10

Sender port (SAP System, EDI external system)

 

Not relevant

SNDPRT

CHAR 2

Partner type of sender

X

Value: "LS"

SNDPRN

CHAR 10

Partner number of sender

X

For example: "S11MAND000" if S11 is the sending SAP-system

SNDSAD

CHAR 21

EDI: SADR fields in total

   

SNDLAD

CHAR 70

Logical address of sender

   

REFINT

CHAR 14

Reference to interchange file

   

REFGRP

CHAR 14

Reference to message group

   

REFMES

CHAR 14

Reference to message

   

ARCKEY

CHAR 70

EDI archive key

   

CREDAT

DATS D 8

Date IDoc was created

   

CRETIM

TIMS T 6

Time IDoc was created

   

MESTYP

CHAR 6

Logical message type

X

For example, WMTORD for transfer orders

IDocTYP

CHAR 8

Name of basic IDoc type

X

For example, WMTOID01 for TOs

CIMTYP

CHAR 8

Name of IDoc type extension

   

RCVPFC

CHAR 2

Partner function of receiver

   

SNDPFC

CHAR 2

Partner function of sender

   

SERIAL

CHAR 20

EDI/ALE: Serialization field

   

EXPRSS

CHAR 1

Overriding in inbound processing

   

* Both fields can be used to incorporate a different module to the standard function module in the ALE service layer in the table of the input methods in order to process the IDoc.

Not all of the fields have to be filled. But you have to initialize the whole structure before filling them and sending the IDoc to SAP.

If you want to send an IDoc from an external system to SAP, you will have to define a logical system for the sender(/nSALE->Distribution model->Logical systems). Then you will have to define partner profile for this partner number.It is not mandatory to specify the Receiving partner (RCVPRN) but we recommend it in order to be able to follow the data flow in SAP. The logical system in SAP is defined per client in table T000.

When the IDoc is created in the R/3 system with the transaction /nWE30, three structures are automatically created for each IDoc segment which are also numbered consecutively, e.g. for the transfer order items E1LTORI, E2LTORI and E3LTORI. E1LTORI is release-neutral, E2LTORI release-dependent and E3LTORI is used for documentation purposes.

When segment names are transferred, you must specify E2 segment names so that these are independent of the SAP release.

In the transfer order example above, (two TOs, each with three items), two internal tables with the following structure would be transferred:

EDI_DD

9000000000123456

E2LTORH

00112345678905011E

... (TO header data)

9000000000123456

E2LTORI

0001FRASCATI

... (Item)

9000000000123456

E2LTORI

0002BORDEAUX

... (Item)

9000000000123456

E2LTORI

0003CHIANTI

... (Item)

9000000000123457

E2LTORH

00112345678912011A

... (TO header data)

9000000000123457

E2LTORI

0001CHATEAU-NEUF

... (Item)

9000000000123457

E2LTOR

0002BORDEAUX

... (Item)

9000000000123457

E2LTORI

0003SOAVE

... (Item)


EDI_DC

9000000000123456

LS

S11MAND002

LS

EXT. SYSTEM

WMTORD

WMTOID01

9000000000123457

LS

S11MAND002

LS

EXT. SYSTEM

WMTORD

WMTOID01