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

Former Member
0 Likes
1,426

Hi

I am having entries like this in my internal table..


    x             y
    23           12
     -              -
    23           25
     -             12 

.

sort itab by x.

( so it will get changed like this)

 x             y
           -              -
           -             12
           23           25
            23           12 

delete adjacent dupilcates from itab comparing x.

but my requirement is i dont want to delete the blank entries in x.

Thanks and Regards,

Arun Joseph

Hi

I am having entries like this in my internal table..


    x             y
    23           12
     -              -
    23           25
     -             12 

.

sort itab by x.

( so it will get changed like this)

 x             y
           -              -
           -             12
           23           25
            23           12 

delete adjacent dupilcates from itab comparing x.

but my requirement is i dont want to delete the blank entries in x.

Thanks and Regards,

Arun Joseph

7 REPLIES 7
Read only

Former Member
0 Likes
1,109

Can any one help me out how to make this??

Read only

0 Likes
1,109

Move the blank values (for field x) in your original internal table(itab) to another internal table(itab2) and delete the duplicates from the original internal table(itab). Then append the values back from the new internal table(itab2) back into the original internal table(itab).

Manoj

Read only

0 Likes
1,109

Hi,

i think with in the loop try this.

if x is not initial.

delete adjacent duplecates comparing x.

endif.

regards.

sriram.

Read only

0 Likes
1,109

Can you please bit more specific?

Read only

0 Likes
1,109

Hi,

supppose your internal table is ITAB having fields like X,Y

X Y

10 10

-- 15

10 10

--- 20

15 25.

when you are writing the data.

loop at itab.

if itab-x is not initial.

delete adjacent duplecants from itab comparing x.

write:/ x,

y.

endif.

endloop.

regards.

sriram.

Read only

former_member787646
Contributor
0 Likes
1,109

Hi,

Try this..

Delete Adjacent Dupilcates from itab comparing all fields.

Hope it helps you.

Murthy

Read only

Former Member
0 Likes
1,109

Thanks