on ‎2008 Mar 13 1:02 AM
Hi Experts,
I want to know the control break statements.
regards,
nagaraju
Request clarification before answering.
Before using control break statement, make sure you sort your internal table.
AT NEW
AT LAST
AT ENDOF
AT FIRST
all control break statements should end with ENDAT.
Use them between LOOP and ENDLOOP.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
Control Break Statements
Control break statements are used to create statement blocks which process only specific table lines the LOOP ENDLOOP block.
You open such a statement block with the control level statement AT and close it with the control level statement ENDAT. The syntax is as follows:
Table should be sorted when you use control-break statements
You can break the sequential access of internal tables by using these statements.
Syntax:
At first.
<Statement block>
Endat.
This is the first statement to get executed inside the loop (remember control break statements are applicable only inside the loop)
So in this block you can write or process those statements which you want to get executed when the loop starts.
At New carrid.
Write:/ carrid.
Endat.
In this case whenever the new carrid is reached, carrid will be written.
At End of carrid.
Uline.
Endat.
In this case whenever the end of carrid is reached, a line will be drawn.
At Last.
Write:/ Last Record is reached.
Endat.
Processing of statements within this block is done when entire processing of entire internal table is over. Usually used to display grand totals.
You can use either all or one of the above control break statements with in the loop for processing internal table.
At end of carrid.
Sum.
Endat.
In above case the statement SUM (applicable only within AT-ENDAT) will sum up all the numeric fields in internal table and result is stored in same internal table variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
AT FIRST---->this is used for system field heading in ABAP program.
AT NEW------>this is used to display the fields.
AT END------>this is used for row-wise calculation i.e, sub-total.
AT LAST----->this is used for calculation of grand total
Do chk out abapdocu as well.
Regards,
Narendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.