SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Internal Tables → Internal Tables - Overview → Table Keys → Primary Table Key →Empty Table Key
The primary table key of a standard table can be empty. An empty table key does not contain any key fields.
Note
Sorted keys and hash keys are never empty, regardless of whether they are primary or secondary.
Declaration
An empty primary table key can be created as follows:
Notes on Use
Uncritical use
An empty primary table key can be used to handle a table like an array. This means that filling the table and other access do not rely on an order determined by key values. In this case, an empty internal table key can be used in all statements that determine (implicitly or explicitly) the order in which the internal table is accessed.
Notes
Example
A particularly prominent example is the statement LOOP AT itab, which when used implicitly or explicitly (using USING primary_key) defines the processing order with respect to the primary table index, but otherwise has no effect.
Critical use
In the following statements, which work with the primary table key without specifying the key fields explicitly, specifying an empty primary table key is critical and generally produces unexpected behavior. An empty table key that can be identified statically produces a syntax check warning.
Note
The statements described above can be particularly unpredictable when using the standard key (which itself can be declared implicitly) to declare an empty internal table key.