05-10-2007 12:10 PM
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
05-10-2007 12:50 PM
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.