SAP ITAB ACCESS

Get Example source ABAP code based on a different SAP table
  


ARTICLE

Access to Internal Tables
When internal tables are read, either the entire table or table body can be accessed, or individual rows.
The table body is read using special statements such as SORT, but can also be accessed using general statements like assignments.
Individual rows are accessed using
special statements such as READ TABLE, LOOP AT, MODIFY.
table expressions itab[ ... ]. When individual rows are read, either a work area is used into which the row content is read or from which it is modified, or a row is associated with a field symbol or a data reference variable and these are used to access the row directly.
The table category and the table keys are significant when internal tables are edited:
The primary table index (which always exists) can be used to access index tables (standard tables and sorted tables).
Primary table keys can be used for optimized access to sorted tables and hashed tables.
A secondary table index can be used to access any tables with a sorted secondary table index.
The secondary table key can be used for optimized access to any tables with a secondary sorted key or hash key. Notes

Notes
If the row type of internal tables contains object reference variables as the components comp, the attributes attr of the object to which the reference points can be used as key values for reading, sorting, and modifying table rows. This is always possible for statements that address individual components of the table.
The content of the primary table key cannot be changed for any writes to individual rows of sorted tables and hashed tables.