‎2007 Mar 03 7:30 PM
hi experts,
can any body will provide me the control statement of internal table.
thank you
‎2007 Mar 03 7:34 PM
‎2007 Mar 03 7:36 PM
Hi,
Control statements of an internal table are:
1. AT FIRST
2: AT NEW
3. AT END OF
4. AT LAST
AT <line>.
<statement block>
ENDAT.
FIRST
the first line of the internal table
LAST
the last line of the internal table
NEW <field>
the beginning of a group of lines with the same contents in <field> and in the superior fields
END OF <field>
the end of a group of lines with the same contents in <field> and in the superior fields
Br,
Laxmi.
‎2007 Mar 03 9:46 PM
hi,
1. AT FIRST
2: AT NEW
3. AT END OF
4. AT LAST
AT <line>.
<statement block>
ENDAT.
FIRST
the first line of the internal table
LAST
the last line of the internal table
NEW <field>
the beginning of a group of lines with the same contents in <field> and in the superior fields
END OF <field>
the end of a group of lines with the same contents in <field> and in the superior fields
nidhi
‎2007 Mar 04 5:12 AM
Hi,
check this link
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9f1f35c111d1829f0000e829fbfe/content.htm
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.
Regards,
Sruthi