‎2007 Aug 16 3:54 PM
Hi all,
can anyone tel lme how to read the record
itab.
f1 f2 f3
1 1 a
1 2 a
1 4 a
1 5 a
2 7 b
2 5 b
3 1 c
3 2 c
loop at itab2 into wa2.
read table itab into wa1 with key f1 = wa-f1
f3 = wa-f3.
i want the max f2 one say if f1 = 1, f3 = a i want 1 5 a
and if f1 =2 AND F3 = B I WANT THIS RECORD IN WA1 2 7 b
endloop.
Thanks
‎2007 Aug 16 4:01 PM
before looping insert the code.
sort itab2 by f1 f2 descending f3.
‎2007 Aug 16 4:01 PM
before looping insert the code.
sort itab2 by f1 f2 descending f3.
‎2007 Aug 16 4:19 PM
‎2007 Aug 16 4:02 PM
‎2007 Aug 16 4:04 PM
Hi preeti,
sort itab.
loop at itab into wa1.
at end of f2.
append wa1 to itab2.
endat.
endloop.Regards,
Clemens
‎2007 Aug 16 4:07 PM
Hi,
Sort the itab by f1, f3 and f2.
then use, AT END OF statement.
AT END OF F1-- move that record into another internal table .
‎2007 Aug 16 4:08 PM
Hi Preeti,
Use SORT statement before LOOP...ENDLOOP.
<b>SORT ITAB BY F1 F2 DESCENDING F3.</b>
loop at itab2 into wa.
read table itab into wa1 with key f1 = wa-f1
f3 = wa-f3.
<b>IF SY-SUBRC = 0.
WRITE:/ WA1-F1 , WA1-F3.
ENDIF.</b>
endloop.
Thanks,
Vinay