SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
Standard Keys in Internal Tables
-
The standard key in
internal tables basically consists of all the table fields with the character-type type
(C, STRING, D,
T, N, X, XSTRING). In particular, components with a
numeric type and table components in general do not belong to the standard key.
-
In internal tables with a nested line structure, the standard key results from linearization of the
line structure, that is, all substructures are resolved recursively until only unstructured table fields
are left to be considered. Of these fields, only those fields that are neither numeric fields nor tables are included in the key.
The linearization is explained in the following example:
TYPES: BEGIN OF PERSONNEL_DATES,
NAME TYPE STRING,
BIRTHDAY TYPE D,
WEIGHT TYPE F,
END OF PERSONNEL_DATES,
BEGIN OF ADDRESS,
STREET TYPE STRING,
CITY(30) TYPE C,
END OF ADDRESS,
BEGIN OF PERSON_RECORD,
NUMBER(10) TYPE P,
DATES TYPE PERSONNEL_DATES,
ADR TYPE ADDRESS,
END OF PERSON_RECORD.
DATA: ITAB TYPE PERSON_RECORD OCCURS 100.
-
The standard key for the internal table ITAB is composed of the fields
ITAB-DATES-NAME, ITAB-DATES-BIRTHDAY, ITAB-ADR-STREET,
and ITAB-ADR-CITY. The fields ITAB-NUMBER and ITAB-DATES-WEIGHT do not belong to the standard key.
-
For tables of non-structured types (that is,tables with an elementary line type, for example C,
I, P, REF TO etc.), the whole line is used as a standard key.
In contrast, for tables over tables, the standard key is empty.