Wednesday, December 24, 2008

Operations on Internal Tables

Operations on Internal Tables

Various operations can be performed on an Internal Table.
Filling Internal Table
->For filling an IT , use the keyword ‘APPEND’
->It appends the contents of the work area at the end of the Internal Table.
Eg: APPEND wa TO itab.

Modifying lines of IT
->To modify individual lines of an IT,use “MODIFY” stmt inside the loop.
->However you must make the required changes in the work area and then assign its contents to the IT.
->MODIFY FROM.

Deleting single table lines
->You can delete single table lines using ‘DELETE’ stmt within the loop.
->DELETE stmt deletes the current line of IT.
->DELETE.

Sorting
->To sort IT will use SORT keyword.
->You can also specify the sorting sequence with SORT and type (ascending/descending).
->SORT BY fieldname.
Ex. SORT BY EID.


LOOP AT stmt..

->IT are processed in loops.in loops all elements of the IT are read starting from the first line.
SYNTAX :LOOP AT itab.
ENDLOOP
For work area,
LOOP AT itab into wa.
ENDLOOP.

Outputting Table contents

->To display the table contents use ‘WRITE’ stmt inside the LOOP AT loop.
Ex: Write:/itab-field1,itab-field2.

Processing control levels

->It allows you to create statement blocks within a LOOP-ENDLOOP loop that are processed only for certain table lines.
->Start with AT and end with ENDAT.
AT.
ENDAT.

->FIRST-first line of IT
->LAST-last line of IT
->NEW-beginning of a group of lines with same contents in the superior fields.
->END OF-end of a group of lines with same contents in the superior fields.



1 comment:

magnific said...

lately, I did not give plenty of thought to giving responses on site page reports and have positioned responses even less. Reading through your pleasant content, will assist me to do so sometimes.
http://www.sapmmonlinetraining.in/

Post a Comment