‎2010 Aug 05 11:17 AM
Hi Group,
Below I have this data in the internal table :
VBELV POSNV VBELN
1100012314 000010 0510350554
1100012314 000020 0510350554
1100012314 000030 0510350554
1100012314 000040 0510350554
1100012314 000050 0510350554
1100012314 000060 0510350554
1100012314 000070 0510350554
1100012314 000080 0510350554
1100012315 000010 0510350554
1100012315 000020 0510350554
1100012315 000030 0510350554
1100012315 000040 0510350554
1100012316 000010 0510350554
1100012316 000020 0510350554
1100012316 000030 0510350554
Could you please tell me a logic for, if there are more than 1 vbelv's in the this internal table then I have to put a flag (coll = 'X')saying its a collective invoice order. Here in this case I have 3 different VBELV's, I need to write a logic that there are more than one VBELV's for the VBELN.
Thanks and Regards,
Kumar.
Edited by: virgo rhyme on Aug 5, 2010 12:18 PM
Moderator message: please use more descriptive subject lines from now on.
Edited by: Thomas Zloch on Aug 5, 2010 12:57 PM
‎2010 Aug 05 11:41 AM
Hello
Try this logic:
data: N type i.
sort itab by VBELV. " <- itab - it is your internal table
delete adjacent duplicates from itab comparing VBELV.
describe table itab lines N.
if N > 1.
* collective
* do anything
else.
* non collective
* do anything
endif.
‎2010 Aug 05 11:41 AM
Hello
Try this logic:
data: N type i.
sort itab by VBELV. " <- itab - it is your internal table
delete adjacent duplicates from itab comparing VBELV.
describe table itab lines N.
if N > 1.
* collective
* do anything
else.
* non collective
* do anything
endif.
‎2010 Aug 05 11:57 AM
Thanks,
Actually I did do the same.
Thanks for your help.
Regards,
Kumar.