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: 

Delete adjacent duplicates

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

Hi,

i think with in the loop try this.

if x is not initial.

delete adjacent duplecates comparing x.

endif.

regards.

sriram.

0 Kudos

Can you please bit more specific?

0 Kudos

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.

former_member787646
Contributor
0 Kudos

Hi,

Try this..

Delete Adjacent Dupilcates from itab comparing all fields.

Hope it helps you.

Murthy

Former Member
0 Kudos

Thanks