‎2007 May 10 11:03 AM
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
Message was edited by:
raja rajan
‎2007 May 10 11:05 AM
hi Raja,
use ...
delete table <internal table> where sno = ...
Regards,
Jayant
‎2007 May 10 11:05 AM
sort itab by Sno.
delete itab index 4.
delete itab index 8.
delete itab index 9.
~Suresh
‎2007 May 10 11:07 AM
Hi Raja,
Looks to be a pretty strange one.
In the records 4,8 & 9 the key is the no. field of value 2. They are all multiples of 2.
4th record - 2
8th record - 4
9th record - 4
so you can delete based on this logic, multiples of 2.
Tushar
‎2007 May 10 11:08 AM
Hi Raja....
if you are taking about the particular tab then you can hard code the value for
sy-tabix...
delete <internal table name> where sy-tabix = '<hard code the tab>'.
in this case no matter what the record is ..always that particular row will be deleted...
Regards,
Jayant
‎2007 May 10 11:09 AM
‎2007 May 10 11:10 AM
Hi Raja,
Refer this code :
loop at itab.
delete itab where sy-tabix = 4.
delete itab where sy-tabix = 8.
delete itab where sy-tabix = 9.
endloop.
Reward points if helpful.
Regards,
Hemant
‎2007 May 10 11:13 AM
Hi,
If you want to directly delete the records corresponding Sr no
delete itab where num eq 4 or num eq 8 or num eq 9.
Thanks
Sandeep
‎2007 May 10 1:38 PM
hi try this.
loop at itab.
do sy-tfill times.
if itab-a = itab-b.
delete itab index sy-tabix.
endif.
enddo.
endloop.
the above deletes the fiels of equal values.
take 2 fields m and n.
m = 1.
loop at itab.
do sy-tfill times.
if m <> itab-a.
m = itab-a.
skip.
read table itab index sy-index.
if itab-a <> m.
delete itab index sy-index.
endif.
endif.
enddo.
endloop.
this should remove the single values.
check it n let me kno if this works.
regards,
ramesh.