Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IDoc error #26 - mandatory segment missing

Former Member
0 Likes
1,413

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

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,162

Hello

Forgetting about your dreadful naming conventions for a moment the problem is appears to be here:


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

Regards

Uwe

4 REPLIES 4
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,163

Hello

Forgetting about your dreadful naming conventions for a moment the problem is appears to be here:


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

Regards

Uwe

Read only

0 Likes
1,162

OMG! This is not the real program I have to do my Buddy!. But, I could solve the issue before I saw ur response. Anyhow, ur findings were correct! Issue was at that point.

Anyways, thx a lot n rewards to u!

Read only

Subhankar
Active Contributor
0 Likes
1,162

Did you maintained the partner profile. Also did you specify the control records while creating idocs.

Thanks

Subhankar

Read only

Former Member
0 Likes
1,162

Solved the Issue