Skip to Content
0
Former Member
Jan 18, 2011 at 07:26 PM

IDoc error #26 - mandatory segment missing

251 Views

Hi

Related to an outbound IDoc for data communication, I have followed the steps:

1. Created Segment, ZTEST_SEG in WE31

2. Created a Basic IDoc Type, ZTEST_IDOC in WE30. Attached segment ZTEST_SEG as mandatory.

3. Created a Message Type, ZTEST_MTYPE in WE81

4. Attached ZTEST_MTYPE to ZTEST_IDOC in WE82

The IDoc is generated by an ABAP program as follows:

From Internal table it_data, I want to pass records to the IDoc. See the coding below:

data : s_ctrlrec like edidc, "IDoc control record

seg_payinfo like ZTEST_SEG. u201CSegment

data : t_edidd like edidd occurs 0 with header line, "data records

t_comm_idoc like edidc occurs 0 with header line. "generated communication idoc

constants : c_seg_payinfo like edidd-segnam value 'seg_payinfo'.

constants : c_idoctp like edidc-idoctp value 'ZTEST_IDOC '.

-


it_data is populated with records here

-


Loop at it_data.

seg_payinfo-field1 = it_data-field1.

seg_payinfo-field2 = it_data-field2.

t_edidd-segnam = c_seg_payinfo.

t_edidd-sdata = seg_payinfo.

append t_edidd.

clear t_edidd.

Endloop.

When I run the program, in WE02, I can see IDoc is generated with errors:

26 EDI: Syntax error in IDoc (mandatory segment missing)

And, NONE of the Segment has any data.

Any suggestions please to fix this issueu2026.

Cheers

RSV