cancel
Showing results for 
Search instead for 
Did you mean: 

BEGIN and SEGMENT Attributes

Former Member
0 Kudos

Hi,

I have JMS -> SAP PI -> IDOC and IDOC -> SAP PI -> JMS scenarios.

So I imported IDOCs into SAP PI. However I see some additional attributes getting added in the IDOC structure, BEGIN and SEGMENT.

My doubt:

1) The original IDOC (in SAP ECC system) does not have them, how/ why are they coming in SAP PI?

2) As they are mandatory, what should I map to them? Some threads say that map constant 1; why only 1?

Thank you,

Pankaj.

Accepted Solutions (1)

Accepted Solutions (1)

andreas_dahl
Explorer

Hello Pankaj,

the IDoc is rendered into XML and it is optimized for the XML-parser. The parser should read the xml as fast as possible, so it is necessary that the xml-data is read only once, this is done by an one-pass XML-parser. The customer can define the segment names and the segment fields arbritrarily, so the beginning of the segments must be marked with an attribute. This is named "SEGMENT". But in XML the attributes must consist of name + value. Now the segment attribute could have got the value

of the segment-number, but this is not practical. Assume that you want to reduce one segment in the middle of the xml, than you have to renumber all segments of the idoc xml (this is very difficult to implement with an XSLT programm). So it

was decided by SAP to set the value of the attributes to "1".

The idoc-tag must have got also an attribute "BEGIN" to distinguish it from a segment field called "IDOC".

I hope that will answer your questions.

Andreas Dahl

Former Member
0 Kudos

Hi,

The information was very helpful.

Is this documented anywhere (in help.sap.com or in some article)?

Thank you,

Pankaj.

Answers (1)

Answers (1)

andreas_dahl
Explorer

Hello Pankaj,

the XML-syntax is documentated with the DTD via R/3 transaction WE60 and the XML-schemata in the XI- repository. There you can find that the values of the attributes "SEGMENT" and "BEGIN" must be "1". The background information

about the development process of IDoc-XML is not documented in the help portal.

Kind regards,

Andreas Dahl