Control Break Statement in SAP ABAP

Control Break Statement : Events

1.AT NEW
2.AT FIRST
3.AT LAST
4.AT END OF
5.ON CHANGE OF

Using these statements we can control the flow of ABAP programming statement within the LOOP........ ENDLOOP statement


AT NEW:
It triggers for a group of similar contents in an internal table.It triggers whenever there is a change in field values in an internal based on character value.

Syntax: 
AT NEW <field-name>.
 .......................
statenments 
.........................
ENDAT.

AT FIRST: 
It triggers during first loop iteration .

Syntax: 
AT FIRST.
....................
STATEMENTS
...........................
ENDAT.

 AT LAST:
It triggers for last line of an Internal Table or last loop iteration.Most of the time AT LAST used to do for GRAND Total.

Syntax:
AT LAST.
................................
................................
ENDAT.

AT END OF:
It will triggers the end of group of similar values in an internal table based on character field.

Syntax:
AT END OF <Field-Name>.
.....................................................
.....................................................
ENDAT.

ON CHANGE OF:
Its similar to AT NEW.

Syntax:

ON CHANGE OF <Field-Name>.
.............................................................
..............................................................
ENDON.




Comments

Popular posts from this blog

New commodity code create in SAP S/4 Hana

BAPI to Change STO PO/ PO Delivery date in SAP

INITCAP- First letter of the word Capital in SAP ABAP