2007 Apr 03 10:17 PM
Hi,
I am getting an error with my customized IDOC EDI: Syntax error in IDoc (segment cannot be identified).
My customized IDOC type only has four segments,<b> <b>ALL</b> in the same level. </b>:
ZTEST (IDOC Type)
--ZSEGMENT1
--ZSEGMENT2
--ZSEGMENT3
--ZSEGMENT4
Yet, when creating an IDOC, I have several segment1's, segment2's, two segment3's and one segment4.
Any ideas?
Thanks in advance.
Kenny
2007 Apr 03 10:32 PM
Hi,
Check following things.
<b>[1].</b> All of your segments are released. Check this in transaction WE31. The release flag should be set. If it is not released, select the segment version and go to menu "Edit ---> Set release".
<b>[2].</b> If all segments are released, then go to transaction WE30 and display your custom IDOC ( not to mentioned again, IDOC should be released too ). Here if you double-click any segment, it will show the small screen with details like,
- mendatory flag
- minimun number
- maximum number
- parent segment
- Hier level.
Here, you check that 'Maximum number" for segments ZSEGMENT1 / 2 / 3 are define with the max possible segments you are creating in your system.
<b>[3].</b> Also, check your code that may be you have mispelled the idoc segment name somewhere ( EDIDD-SEGNAM ).
Please let me know if you still get the error.
Regards,
RS
2007 Apr 03 10:32 PM
Hi,
Check following things.
<b>[1].</b> All of your segments are released. Check this in transaction WE31. The release flag should be set. If it is not released, select the segment version and go to menu "Edit ---> Set release".
<b>[2].</b> If all segments are released, then go to transaction WE30 and display your custom IDOC ( not to mentioned again, IDOC should be released too ). Here if you double-click any segment, it will show the small screen with details like,
- mendatory flag
- minimun number
- maximum number
- parent segment
- Hier level.
Here, you check that 'Maximum number" for segments ZSEGMENT1 / 2 / 3 are define with the max possible segments you are creating in your system.
<b>[3].</b> Also, check your code that may be you have mispelled the idoc segment name somewhere ( EDIDD-SEGNAM ).
Please let me know if you still get the error.
Regards,
RS
2007 Apr 03 10:39 PM
Hi RS,
Thanks for the reply.
I have already released all the segments and the idoc type. I am also quite sure I have spelled the right segment names in my codes since when I open the IDOC in we02, all the data is there. Also all minimum number is set to 1 and all maximum number is set to 9999 for all four segments,
The only problem is that I still get the same error. The error is The segment ZSEGMENT1 does not occur at the current level of the basic type ZTEST (extension ).
What does this mean?
Thanks.
Kenny
2007 Apr 03 10:46 PM
Hi,
First of all, ZTEST is basic type ( custom idoc ) or extension idoc? Let me know.
Also, if ZSEGMENT1 does not occur at the current level, there is problem in program which populates the IDOC.
If you look at the IDOC in WE02, are you seeing segment ZSEGMENT1 ( or any other segment ) out of order, then it must be a program error which is generating IDOC.
Let me know what you find out.
Regards,
RS
2007 Apr 03 10:52 PM
Hi,
ZTEST is a basic type.
In we02, I am seeing all ZSEGMENT1 I have tried to populate in my program. This is actually the weird thing, when I look at the Idoc it has everything I need.
Thanks for the reply.
Kenny
2007 Apr 03 10:58 PM
Hi,
So you still have a problem or your issue has been resolved?
Regards,
RS
2007 Apr 03 11:01 PM
Hi RS,
The IDOC seem to have everything I need but still encounters an error.
Thanks.
Kenny
2007 Apr 03 11:45 PM
You have to have one parent as an IDoc is a hierarchical object. Create a dummy parent segment with one field and fill it with a constant value. After that you have to create each segment in that order and once one of them is completed, you will have to create the next set as a separate IDOC. Your logic will be something like this.
loop at itab.
fill parent segment.
fill segment 1.
fill segment 2.
fill segment 3.
fill segment 4.
create idoc.
endloop.