ABAP Keyword Documentation → ABAP Dictionary → Classic Objects in ABAP Dictionary → Database Tables → Semantic Attributes of Database Tables → Table-Specific Semantic Attributes of Database Tables
Flag for Initial Values in Database Tables
Table fields of database tables can be given a flag for initial values. On the database, this flag is set to NOT NULL. When a new field is inserted into an existing database table, this flag can be used to assign the type-compatible initial value to this field in all rows. This is always the case in key fields.
If this flag is not set when a new field is inserted into an existing table, the field is given the
null value in all rows. This value does not have a counterpart in ABAP and, in
Open SQL, can only be queried
using the special WHERE
condition IS [NOT] NULL
.
This flag is only needed when inserting new fields and the initial value is always set. This is of particular importance when tables are converted.
If the flag is set for an entire include structure, it only applies to those structure components where the flag is also set and not to all components. If the flag is not set for an include structure, all flags set in the included structure are ignored.
Other versions:
7.31 | 7.40 | 7.54
Notes
- The flag cannot be set for data types without an initial value, namely LCHR, LRAW, RAW, and VARC plus NUMC with a length of 70 or greater.
- In tables with many rows, it can take a long time to set the type-compatible initial value and the initial value flag should only be used if absolutely necessary or if the table has a small number of entries.
- Generally, table fields on the database are created as NOT NULL even if the flag for the initial value is not set in ABAP Dictionary:
- When a new table is created, all fields of the table are created as NOT NULL.
- When a table is converted, all fields are given the attribute NOT NULL.