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: 

please give some logical code

Former Member
0 Kudos

Hi Experts,

Please give me the logic for the given below scenario

I-Table

A B

1 a

1 b

1 c

2 d

3 a

3 e

3 f

4 g

4 g

In the above itab , itab have lot of records (1000000). i want to display what are all having multiple values only in column A.i want to delete single records (like 2 d(4th row)this row will be delete ) if column A and column B having same value i want to delete that rows.

Thanks & Regards,

Rajan

1 REPLY 1

Former Member
0 Kudos

Hi Raja..

Just paste this code..solves ur problem

data:

begin of itab occurs 0,

f1 type i ,

f2 type c value 'X',

end of itab.

data wa_itab like line of itab.

data:

w_temp type i,

w_ctr type i.

itab-f1 = 1.

append itab.

itab-f1 = 1.

append itab.

itab-f1 = 2.

append itab.

itab-f1 = 2.

append itab.

itab-f1 = 2.

append itab.

itab-f1 = 7.

append itab.

itab-f1 = 3.

append itab.

itab-f1 = 4.

append itab.

itab-f1 = 4.

append itab.

itab-f1 = 5.

append itab.

sort itab by f1.

loop at itab.

<b>at new f1.</b>

w_ctr = sy-tabix + 1.

read table itab index w_ctr into wa_itab.

if itab-f1 ne wa_itab-f1.

continue.

endif.

<b> endat.</b>

write: / itab-f1, itab-f2.

endloop.