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

delete adjacent duplicates required within a loop

former_member632991
Active Contributor
0 Likes
1,079

can i use st.

delete adjacent duplicates from itab1 comparing vbeln without a loop on itab1.

or it should be used within a loop on itab1.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
715

You do not need it in a loop. However you need to sort the table by the fields you are checking for duplicates in.

4 REPLIES 4
Read only

Former Member
0 Likes
716

You do not need it in a loop. However you need to sort the table by the fields you are checking for duplicates in.

Read only

Former Member
0 Likes
715

sort ur internal table by field Vbeln and then use delete adjacent duplicates clause.

u need not to use Loop in that.

for e.g -

u can use liek this -

sort itab by vbeln.

DELETE ADJACENT DUPLICATES FROM ITAB.

amit

Read only

Former Member
0 Likes
715

No need to loop...

you can staraight away write this:

delete adjacent duplicates from itab1 comparing vbeln.

Thanks

Read only

Former Member
0 Likes
715

hi Sonika,

Pls make sure the table itab is SORTed by the field based on which you want to delete; befor the DELETE ADJACENT .... stmt.

This statement can be issued without a loop. That is the advantage of this syntax.

Regards,

Vivek

**->Reward all correct, helpful ansers.