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

Logic Help

Former Member
0 Likes
458

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
433

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.

2 REPLIES 2
Read only

Former Member
0 Likes
434

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.

Read only

0 Likes
433

Thanks,

Actually I did do the same.

Thanks for your help.

Regards,

Kumar.