ABAP Keyword Documentation → ABAP - Dictionary → Classic Objects in ABAP Dictionary
Database Tables
In ABAP Dictionary, the term "database table" (or table for short) is the database-independent definition of a database table.
- A database table is a two-dimensional matrix which consists of rows and columns (fields).
- A field or combination of fields that uniquely identifies every row in a table is known as a table key. This is a minimal attribute: if one of the fields is removed from the key, the remaining fields cannot uniquely identify the table rows.
- A primary key must exist for every table.
- In the relational model, the relationship between objects is expressed in terms of a foreign key.
In ABAP SQL, only those database tables can be accessed that are defined in ABAP Dictionary.
The name of a database table in ABAP Dictionary can have a maximum of 16 characters, can consist of letters, numbers, and underscores, must start with a letter, and can be prefixed by a namespace prefix (/.../) from a prefix namespace. It is located in the namespace of the data types in ABAP Dictionary and in the namespace of the global object types in the class library.
The definition of a database table consists of the following:
- Additional technical attributes of the database table
- Additional semantic attributes of the database table
The most common table category of database table is the transparent table. When the table is activated, the platform-specific SQL DDL statement CREATE TABLE is used to generate a physical database table with all indexes from its definition in ABAP Dictionary (if this is not excluded explicitly in the definition). This is done in the ABAP database schema in the standard AS ABAP database. The built-in types in ABAP Dictionary used to define the components of the structure are implemented as database-specific types. The definition of a table in the database can be displayed in ABAP Dictionary by choosing Utilities → Database Object. As well as normal transparent tables, there are also special global temporary tables (GTTs) for saving temporary data within a work step.
The order of the fields in ABAP Dictionary and on the database does not need to match. More specifically, the order of the table fields (with the exception of key fields) of existing database tables in the dictionary can be modified without modifying the database object. When using ABAP SQL, this is handled accordingly in the database interface and the order in ABAP Dictionary always applies. When using Native SQL, the order of the columns in the database system must be applied explicitly. If AMDP is used, the results are placed in the same order as in ABAP Dictionary (if possible).
Database tables can be defined as
form-based structures in transaction SE11 or as source-code-based structures using
Dictionary DDL in the
ABAP Development Tools. The following section is a summary of the syntax of the source code-based definition:
If existing database tables are modified, conversions may be necessary.
Other versions:
7.31 | 7.40 | 7.54
Notes
- Customizing includes and append structures are available for making enhancements to database tables in ABAP Dictionary delivered by SAP without making modifications.
- Suitable CDS views can be defined as replacement objects for transparent database tables. In this case, reads in ABAP SQL access the replacement objects rather than the database tables.
- Database tables managed by ABAP Dictionary should not be accessed directly in the database (see Access to ABAP-Managed Database Objects).
Continue
Technical Attributes of Database Tables
Semantic Attributes of Database Tables