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

Internal Table

Former Member
0 Likes
300

Hi ,

Can anyone please tell me the syntax to for which we can check the values of an internal table for duplicates and avoid it.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
281

Hi,

To delete duplicate records from internal table you can check this code:

sort itab by a b c.

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING a b c.

or

sort itab.

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING all fields.

3 REPLIES 3
Read only

Former Member
0 Likes
282

Hi,

To delete duplicate records from internal table you can check this code:

sort itab by a b c.

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING a b c.

or

sort itab.

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING all fields.

Read only

Former Member
0 Likes
281

Hi,

First sort the internal table on the field on which you want to check for the duplicates.

then:

Delete adjacent duplicates from ITAB.

Please close the thread if it is solved.

Regards,

Vinod.

Read only

venkata_ramisetti
Active Contributor
0 Likes
281

Hi Bharat,

If just want to delete all duplicates, you can use the below lgic.

SORT ITAB BY FIELD1 FIELD 2.

DELETE ADJACENT DUPLICATES FROM itab COMPARING ALL FIELDS.

Make sure that you sort you internal table in such way all dusplicate records should come adjacent.

Thanks

Ramakrishna