ABAP Keyword Documentation → ABAP - Dictionary → Classic Objects in ABAP Dictionary → Data Types → Table Types
Technical Attributes of Table Types
A table type describes an internal table with the following technical attributes:
- Row type
- Any row type can be defined by referencing any data type, including database tables and classic views in ABAP Dictionary.
- Elementary or reference-like row types can also be specified by using their technical attributes directly. This is done in the same way as with data elements or structure components.
- Table category
- Index table as a generic table category for standard tables and sorted tables
- Any table as a generic table category for all table categories
- Table key
- A primary key as a primary table key. The primary key is either the standard key, the entire table row (if this is not a table type or does not contain a table type as component), or is defined using individual components of a structured row type in the relevant order. A primary key of sorted tables and hashed tables can be given a unique alias name from the namespace of the secondary keys. It is not currently possible to specify an empty primary table key explicitly in ABAP Dictionary. Depending on the table category, the primary key is either unique or non-unique (and cannot be specified at all in the case of generic table categories). If no primary key is specified or its uniqueness is not defined, the table type is generic with respect to this attribute.
- Up to 15 secondary keys as
secondary table keys. Each secondary key has a unique name, which cannot be PRIMARY_KEY or LOOP_KEY,
and is either a sorted key or a hash key. Sorted keys can be either unique or non-unique and a hash
key is always unique. A secondary key is defined either by the entire table row (if this is not a table
type or does not contain a table type as component), or is defined using individual components of a
structured row type in the relevant order. Using the additions
WITH or WITHOUT FURTHER SECONDARY
KEYS of the statement
TYPES, it is possible to define explicitly whether the table type is generic with respect to the secondary keys.
- Initial row count
INITIAL SIZEin the declaration of an internal table in an ABAP program.
7.31 | 7.40 | 7.54
- Generic table types (namely table types for which one or more attributes are generic) can only be used in ABAP for generic typings of formal parameters or field symbols.
- A row type cannot be defined using a reference to a CDS entity, but it can be defined using a reference to a CDS database view of a CDS view.