05-04-2009 2:08 PM
Hi All,
Consider i am having an internal table with few fields 1.matnr 2.date . Now i want to use AT END OF control loop statement . We all know if i use AT END OF DATE if there is any change in matnr or date, at end of will be fired.
But my scenerio is the 'AT END OF' should be fired only based on date at the same time i want to maintain the sequence of the field ( simply it should not consider first field ) How can i do that?
05-04-2009 2:20 PM
Hi
try like this.
data : v_date type date.
loop at itab.
if sy-tabix ne 1.
if v_date ne itab-date.
u r code.
endif.
endif.
v_date = itab-date.
endloop.
u r code.
after the loop also u have to wirte ur code.....
Kiran...
05-04-2009 2:53 PM
Hi
i think ,insted of AT END OF ,you can use
ON CHANGE OF.....
END ON.
Ex:
ON CHANGE OF DATE.
your code
ENDON.
Regards
Hareesh Menon
05-04-2009 4:32 PM
Hi,
Try like this..
Sort the internal table by date matnr.
SORT itab by date matnr.
In the loop..
loop at itab.
at end of date
endat.
endloop.
now make use of date in at end statement.
Thanks and Regards,
KC