Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

At end of Trick

Former Member
0 Kudos

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?

3 REPLIES 3

Former Member
0 Kudos

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...

Former Member
0 Kudos

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

Former Member
0 Kudos

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