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)
- 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
- Enhancement category
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).
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.