05-09-2007 8:44 AM
Hi all,
Is there a way to get the row with smallest value in 1 of the column from an internal table? For example, I had an internal table of 5 rows, and just 2 columns.
Column1 = Round numbers (1,2,3,4,5) and column2 = indicator (X or space). I want the row where column1 is smallest to have X in column2. Is there a way to do this?
05-09-2007 8:47 AM
Hi
ITAB has 2 columns f1 and f2
SORT ITAB BY f1.
Read table ITAB index 1.
this record will give you the neede one.
Reward points if useful
Regards
Anji
05-09-2007 8:50 AM
05-09-2007 9:02 AM
data : tabix like sy-tabix,
small type i.
sort iatb by f1.
loop at itab.
if itab-f2 = 'X'.
tabix = sy-tabix.
exit.
endif.
endloop.
read table itab index tabix.
write : / itab-f1.
reagrds
shiba dutta