‎2008 May 30 7:18 AM
Hi Guys,
My internal table data is in such way
first row : a b c d
second : a b c d e
here you can see the first and second row data is same except 5th column so now i want to delete first row i need only second row where maximum data is filled.
how can it possible there are pleanty of data in itab in same way.
Amit.
‎2008 May 30 7:28 AM
hi,
assuming that one column doesnt have data.
loop at itab.
v_tabix = sy-tabix.
read table itab into wa_itab where f1 = itab-f1
f2 = itab-f2
f3 = itab-f3
f4 = itab-f4.
if sy-subrc = 0.
v_new_tabix = sy-tabix.
if itab-f5 is initial.
delete itab index v_tabix.
else.
if wa_itab-f5 is initial.
delete itab index v_new_tabix.
endif.
endif.
endif.regards,
madhu
‎2008 May 30 7:22 AM
hi,
check out with statement delete adjacent duplicates ..
delete adjacent duplicates of itab comparing f1 f2 f3 f4.Regards,
Santosh
‎2008 May 30 7:24 AM
Santosh,
there is 30 fields in itab i gave example of only 5 fields.
and i need only maximum filled line.
Amit.
‎2008 May 30 7:25 AM
HEY....
use DELETE ADJASCENT DUPLICATES FROM ITAB COMPARING FLD1 FLD2 FLD3 FLD4....
It will solve ur issue...
Reward helpful answers,
Thanks.
‎2008 May 30 7:28 AM
hi,
assuming that one column doesnt have data.
loop at itab.
v_tabix = sy-tabix.
read table itab into wa_itab where f1 = itab-f1
f2 = itab-f2
f3 = itab-f3
f4 = itab-f4.
if sy-subrc = 0.
v_new_tabix = sy-tabix.
if itab-f5 is initial.
delete itab index v_tabix.
else.
if wa_itab-f5 is initial.
delete itab index v_new_tabix.
endif.
endif.
endif.regards,
madhu
‎2008 May 30 7:30 AM
TYPES : BEGIN OF ty_itab,
a(10),
b(4),
c(4),
d(6),
e(6),
END OF ty_itab.
DATA : it_itab TYPE TABLE OF ty_itab.
DATA : is_itab TYPE ty_itab.
is_itab-a = 'a'.
is_itab-b = 'b'.
is_itab-c = 'c'.
is_itab-d = 'd'.
append is_itab to it_itab.
is_itab-a = 'a'.
is_itab-b = 'b'.
is_itab-c = 'c'.
is_itab-d = 'd'.
is_itab-e = 'e'.
append is_itab to it_itab.
clear is_itab.
delete adjacent duplicates from it_itab comparing a b c d.