‎2008 Jun 23 4:52 AM
Hi All,
I am having one internal table with three fields i.e f1, f2, f3. Now my requirement is i have to display the record from internal table in which f2 value is maximum.
regards
shashikanth naram
‎2008 Jun 23 4:57 AM
Hi,
SORT your internal table in descending order by F2.
read the first record.
EX; SORT itab by F2 DESCENDING. Now max. value will come in first.
READ the value.
LOOP AT ITAB.
ON CHANGE OF itab-f2.
READ ITAB WITH KEY ..........
ENDON.
ENDLOOP .
‎2008 Jun 23 4:57 AM
Hi,
SORT your internal table in descending order by F2.
read the first record.
EX; SORT itab by F2 DESCENDING. Now max. value will come in first.
READ the value.
LOOP AT ITAB.
ON CHANGE OF itab-f2.
READ ITAB WITH KEY ..........
ENDON.
ENDLOOP .
‎2008 Jun 23 4:58 AM
sort internal table by f2 and then use select upto 1 row statement
‎2008 Jun 23 4:59 AM
Hi Shashi,
Here is the logic.
1. Create 2 workarea (WA1 and WA2 )of the same type .
2. Now Loop at it_final,
Loop at itab.
If itab-f2 > wa1-f2.
wa2 = itab.
Endif.
wa1 = wa2.
Endloop.
Write:/ ' Maximum Value' , wa2-f1, wa2-f2, wa2-f3.
&**************Reward Point if helpful*****************&
‎2008 Jun 23 4:59 AM
Hi shashikanth,
1. sort the internal table itab by f2 in descending order.
2. read the first line, gives the maximum value.
Ex.
Sort itab by f2 descending.
read table itab index.
reward if found helpful.
Regards,
Boobalan Suburaj
‎2008 Jun 23 5:02 AM
Hi,
sort the internal table with descending order by the field f2 and then use read table to get the first record.
Thanks,
Arunprasad.P
‎2008 Jun 23 5:13 AM
Hi
Sort your itab by desecding f2.
than: read itab index 1.
write:f1,f2,f3.
vipin
Edited by: Vipin on Jun 23, 2008 9:44 AM
‎2008 Jun 23 5:15 AM
‎2008 Jun 23 5:26 AM
Hi,
You can do as below :
SORT ITAB BY F2 DESCENDING.
READ TABLE ITAB INDEX 1.
WRITE : ITAB-F1, ITAB-F2, ITAB-F3.
Thanks,
Sriram POnna.