Application Development 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: 

Internal Table

Former Member
0 Kudos

Hi Experts,

My Internal table has the following structure and data's.

Name age Sex

B 20 MALE

A 22 MALE

B 20 MALE

C 28 MALE

I want to delete the duplicate entries (B) fro my internal table.

Any body help me on this issue.

Thanks,

Points Assured.

1 ACCEPTED SOLUTION

former_member195698
Active Contributor
0 Kudos

sort the table and use <b>delete adjacent duplicates comparing all fields</b>

regards

abhishek

10 REPLIES 10

former_member195698
Active Contributor
0 Kudos

sort the table and use <b>delete adjacent duplicates comparing all fields</b>

regards

abhishek

0 Kudos

Hi,

I tried with delete adjacent duplicates comparing all fields.

But its not delete the dupplicate entries.

The think is I used this code in Class[se24].

Thanks.

0 Kudos

Its possible in Classes also. I tried it in a method of a class.

sort INTERNALTABLE.

delete adjacent duplicates from INTERNALTABLE comparing all fields.

Check in debug whether your data is coming sorted properly before the DELETE statement and also whether there are really any duplicate entries comparing all the fields in the table.

0 Kudos

Jasmine,

the correct statement in this case is:

DELETE ADJACENT DUPLICATES FROM itab.

you don't need COMPARING...

ec

former_member386202
Active Contributor
0 Kudos

Hi,

Do like this

sort itab by name age sex

DELETE ADJACENT DUPLICATES FROM itab COMPARING name age sex.

Regards,

Prashant

former_member188829
Active Contributor
0 Kudos

Hi,

Sort Itab By Name.

Delete adjacent duplicates From itab Comparing Name.

Former Member
0 Kudos

Hi

delete adjacent duplicates from itab comparing names.

Or delete adjacent duplicates from itab comparing all fields.

Regs

Manas

Former Member
0 Kudos

Hi Experts,

Thanks for the replies.

My Internal table has the following,

Name age Sex

B 20 MALE

A 22 MALE

B 20 MALE

C 28 MALE

I need to outout as,

Name age Sex

B 20 MALE

A 22 MALE

C 28 MALE

So for this ouput I couldn't use Delete adjacent Duplicate.

My WA has,

Name age Sex

B 20 MALE

How can I do that?

Thanks.

0 Kudos

use

sort itab by name age sex.

delete adjacent duplicates from itab comparing all fields.

it will work...

Regards

vasu

Former Member
0 Kudos

Thanks