ABAP Keyword Documentation →  ABAP Programming Guidelines →  Robust ABAP → 

Internal Tables

An internal table is a dynamic data object consisting of a sequence of rows with the same data type. The data type of an internal table is a table type that has the following basic properties of every internal table:

The row type can be any data type. In particular, tables of
elementary types, tables of structures, tables of tables, and
tables or references are all possible.
The table category specifies the type of storage and primary access. The possible table categories are:
Every internal table has a primary table key. A table key consists of columns from the internal table. The content of these columns identifies table rows. The table category determines whether a key is unique or non-unique.

Internal tables enable variable datasets (a variable number of rows) with a fixed structure (the row type) to be edited in the working memory of the internal session of a program. The content of an internal table can either be accessed sequentially in a LOOP or by accessing inidividual rows (for example, by using READ TABLE or a table expression).

There are two ways of accessing individual rows:

Primary table access is possible for all three table categories. Access using the primary key, however, is optimized only for sorted tables and hashed tables. In standard tables, primary key access uses a linear search. Access using the primary row index, on the other hand, is possible for standard tables and sorted tables only. As well as its primary key, an internal key can also have further secondary keys. These keys enhance and optimize access options to the various table categories.




Continue
Selecting the Table Category
Secondary Key
Initial Memory Requirements
Sorted Filling
Collected Filling
Output Behavior
Loop Processing