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
935

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
Read only

former_member195698
Active Contributor
0 Likes
911

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

regards

abhishek

10 REPLIES 10
Read only

former_member195698
Active Contributor
0 Likes
912

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

regards

abhishek

Read only

0 Likes
911

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.

Read only

0 Likes
911

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.

Read only

0 Likes
911

Jasmine,

the correct statement in this case is:

DELETE ADJACENT DUPLICATES FROM itab.

you don't need COMPARING...

ec

Read only

former_member386202
Active Contributor
0 Likes
911

Hi,

Do like this

sort itab by name age sex

DELETE ADJACENT DUPLICATES FROM itab COMPARING name age sex.

Regards,

Prashant

Read only

former_member188829
Active Contributor
0 Likes
911

Hi,

Sort Itab By Name.

Delete adjacent duplicates From itab Comparing Name.

Read only

Former Member
0 Likes
911

Hi

delete adjacent duplicates from itab comparing names.

Or delete adjacent duplicates from itab comparing all fields.

Regs

Manas

Read only

Former Member
0 Likes
911

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.

Read only

0 Likes
911

use

sort itab by name age sex.

delete adjacent duplicates from itab comparing all fields.

it will work...

Regards

vasu

Read only

Former Member
0 Likes
911

Thanks