‎2011 Jan 18 7:26 PM
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
‎2011 Jan 18 7:34 PM
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
‎2011 Jan 18 7:34 PM
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
‎2011 Jan 18 9:08 PM
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!
‎2011 Jan 18 7:36 PM
Did you maintained the partner profile. Also did you specify the control records while creating idocs.
Thanks
Subhankar
‎2011 Jan 18 9:20 PM