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:
- Row Type
- Table Category
- Standard tables administered using a primary table index and which cannot have a unique primary table key.
- Sorted tables administered using a primary table index and that can have a unique or non-unique primary table key (used to sort the table).
- Hashed tables whose primary table key always has to be unique and which use a hash algorithm (distributed memory management) to administer their rows. A hashed table does not have a primary table index.
- Primary Table Key
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
There are two ways of accessing individual rows:
- By specifying a key (a table key or a free key)
- By specifying a row index
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 standar 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.