Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8507

Re: Regarding At New in loop..

$
0
0

This behavior is described in on-line help, you could also press F1 on source editor.

 

If you need more fields in your AT NEW block, then only set a flag and outside of AT/ENDAT block execute some code.

 

In a AT END OF/ENDAT bock, you must have previously saved the record data in another work area and not the work area/fs defined in the LOOP statement.

 

LOOP AT itab ASSIGNING <fs>.   AT NEW field1.     flag_new_field1 = abap_true.   ENDAT.   IF flag_new_field1 IS NOT INITIAL.     " perform something     CLEAR flag_new_field1.   ENDAT.   wa_previous_record = <fs>.   previous_index = sy-tabix. " if standard/sorted table   AT END OF field2.     " perform somethong with wa_previous_record   ENDAT.
 ENDLOOP.

 

Regards,

Raymond


Viewing all articles
Browse latest Browse all 8507

Trending Articles