07-05-2007 10:48 AM
Hi,
I have a custom IDoc with 2 same level segments, No mandatory segments are there. These two segment's max number of repetitions are 99999.
I am filling the IDocs in the following way.
I am filling the first segment in a loop after that I am filling the second segment in a nested loop of the first loop. After filling the second segment it is again going to first segment and it is filling and this process is going on until the loop ends.
I am getting the 26 syntax error in the IDoc.
My IDOC # is in the following way right now.
1st segment
2nd segment
1st segment
2nd segment
1st segment
2nd segment
Can anybody tell me, is this filling of IDoc is wrong or correct.
Thanks,
BSV.
07-05-2007 10:53 AM
no you need to fill first segament first..and then fill the second one..
if u have a complex input data ..then break it into two internal tables..
then fill seaments1 with first internal table and then second segament with another internal table..
cheers:)
07-05-2007 11:09 AM
Hi bsv,
If I understood your questino correctly, then...
Usually one header record will be having a set of item records. Lets suppose u r generating IDOC's based on a Z program which extracts some data based on a selection screen entries into (lets suppose) two internal tables (1 - header and 1 - item table).
In this scenario, you have to loop through the 1st internal table, fill header segment and loop through the 2nd internal table (nested loop) for the corresponding header record and after the nested loop, you can call the function module that generates the idoc. Now, this continues for all the header and its corresponding items and generates 'n' number of IDOC's based on entries in header table.
Hope it solves your problem.
Regards,
Phani.