Skip to content

ABAP Keyword Documentation →  ABAP - Dictionary →  Classic Objects in ABAP Dictionary →  Database Tables →  Technical Attributes of Database Tables 

Structure-Specific Technical Attributes of Database Tables

The following technical attributes are mostly the same as those of a structure in ABAP Dictionary:

  • Table fields (columns)
A table field is a component of the structure of the database table and describes the name, the data type, and any semantic attributes of a field of a database table. A table field is a component of the structured data type of the table and the associated rules apply to the component name and component type, with the following restrictions:
  • The name of a table field cannot be a reserved name. The reserved names that cannot be used are specified in the database table TRESE. This is also important when using include structures.
  • A table field always has one elementary data type. Reference types, substructures, and table types are not possible. The elementary data type is specified directly for the table field or by using a data element and is always based on a built-in type in ABAP Dictionary. A table field has a platform-specific type in the physical database table. For each platform, there is a mapping between the elementary types in ABAP Dictionary and the platform-specific types. If only ABAP SQL is used, this mapping is transparent for ABAP programmers and only the built-in types in ABAP Dictionary and their ABAP types are relevant for the ABAP program.
  • Fields with the type CHAR can have a maximum of 1333 characters.
  • Fields with the type LRAW or LCHR must be at the end of the table. Only one such field is allowed per table. Furthermore, a field with the type INT2 or INT4 (for the maximum length of the field) must be located directly in front of this field.
  • Fields of the obsolete types DF16_SCL and DF34_SCL must be followed directly by a field of type INT2 for scaling.
  • Include structures
Structures (but not database tables or views) can be included in a database table as include structures. A structure can only be included in a table if its components meet the table field prerequisites above. In particular, an included structure cannot contain any substructures. Any naming conflicts must be bypassed by defining suffixes. As in regular structures, the include can be assigned the name of a group.
When a structure is included, all its fields can be flagged as key fields. The include structure must then be inserted in the existing key fields or directly after them. Individual fields of an included structure cannot themselves be key fields.
When an include structure is included, the flag for initial values can be set for the entire structure. In this case, those fields in the include structure for which this attribute is set also keep their attribute. If the flag for initial values is not set for the included include structure, none of its fields have this attribute.
The fields of an included include structure are still part of the structure. They can only be edited using the structure and any changes made to the structure are applied to all including database tables. The fields of an included include structure can also be transformed to direct fields of the database table that are no longer associated with the originally included structure.
  • Enhancement category
The same applies to the enhancement category of database tables as to the enhancement category of structures.

The following applies with respect to the number of fields and length of the structure of a database table:

  • Number of fields
  • A table in the software component SAP_BASIS can contain a maximum of 749 fields.
  • A table in a software component other than SAP_BASIS can contain 1000 fields if the storage type is Row Store and 1500 fields if the storage type is Column Store.
  • The total of all field lengths is restricted. The following applies with respect to the total of the number of bytes of the non-character-like fields plus the number of characters of the flat character-like fields:
  • In a table in the software component SAP_BASIS, the total cannot be greater than 4030.
  • In ABAP Dictionary, no limit applies to tables in software components other than SAP_BASIS. The limit defined in the current database platform applies (in the SAP HANA database this is 512 KB).
In the case of deep fields such as STRING, RAWSTRING, LRAW, LCHR, and GEOM_EWKB, only the bytes of the references are counted and not the actual content.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • Nested structures cannot be used to write to database tables because these structures are not possible in every supported database.

  • If it meets the prerequisites above, an existing structure can be transformed to a database table. Conversely, a database structure can also be transformed to a regular structure (this deletes the database object).

  • The limit on the number of fields and the length of the structure for tables in the software component SAP_BASIS is chosen deliberately so that the requirements of any supported database platform can be met. At SAP, tables can be flagged to allow this restriction to be exceeded if enhancements are used. When tables flagged in this way are accessed using ABAP SQL, a syntax warning from the extended program check occurs. The warning indicates that a cross-platform replacement implementation may be necessary. The class CL_ABAP_DBFEATURES can be used to identify which limit is supported by a particular database system. The limits applied to tables in other software components for S/4 HANA is only defined by the SAP HANA database.