Friday 15 December 2017

Types Of Control Break Statements in SAP ABAP ?

Control break statements are like events inside the loop.

There are 5 control break statements in ABAP. These are used within loop.
The control break ON CHANGE OF / ENDON, can be used in any loop, It can also be used in WHILE ... ENDWHILE.

There are Five control break statements :
At First / End At
At Last / end At
At New / End At
At End Of / End At
On Change Of / EndOn

1. At First / End At 
At First Will trigger at the first run of the loop.
it means At Firs triggers at the first loop iteration
The main purpose of this control break is to write some header information.
We can write some header info by using AT FIRST statement

2. At Last / end At
At Last triggers at the last loop iteration.
it means At Last will trigger at the last run of the loop.
The main purpose of this control break is to write some footer information.
We can write some footer info by using AT LAST statement.

3. At New / End At 
At New is one of a control break statements.
It works inside the LOOP – ENDLOOP.
When we use At new for a field, it will trigger whenever there is any change of fields’ data.
This statement triggers at the new occurrence of that value.

4. At End Of / End At
At End OF statement always triggers when there is any change of fields’ data.
This statement triggers at the last occurrence of that value.

5. On Change Of / EndOn
On change of it triggers only when there is any change in the particular field.
On change of can be used outside the loop too.
it actually works like AT NEW statement.
If there is any change of the value of the mentioned field then ON CHANGE OF will trigger.



No comments:

Post a Comment

In this post we use some basics Events  and Control Break Statements for Generating Classical Report Based On single Table. If You want so...