Mentor SAP

Transparent Tables

The structure of the objects used in application development is mapped to tables in the database system. The attributes of these objects correspond to the fields of the table.

 

A table consists of columns (fields) and rows (entries). The table has a name and different general attributes, such as delivery class and maintenance authorization.

 

A field has a unique name and attributes; for example, a key field.

 

A table has one or more key fields. The values of these key fields uniquely identify a table entry. These key fields collectively are called as a primary key.

 

​You must specify a reference table for fields containing a currency (data type CURR) or quantity (data type QUAN). A reference table must contain a field (reference field) with the format for currency keys (data type CUKY) or the format for units (data type UNIT). The field is only assigned to the reference field at program runtime.

 

 

Basic Objects of the ABAP Dictionary

The basic objects for defining data in the ABAP Dictionary are as follows:

 

A field is not an independent object. It is table-dependent. You can only maintain a field within a table. You can enter the data type and number of places directly for a field. No data element is required in this case. Instead, you can choose a predefined type to specify the data type and number of places.

 You can specify the technical attributes of a data element even without using a domain. To do so, you enter the built-in data type and the number of places directly.

 

 

 

Example of Two-Level Domain Concept

The table SPFLI stores the flight schedule.

 

Table fields AIRPFROM (departure airport) and AIRPTO (arrival airport) have the same domain S_AIRPID. Because both fields use the same domain and contain airport IDs, they have the same technical attributes. Both table fields have a different semantic meaning and use different data elements. Field AIRPFROM uses data element S_FROMAIRP and field AIRPTO uses data element S_TOAIRP.

 

 

Transparent Tables and Structures

A table is automatically created in the database when a transparent table is activated in the ABAP Dictionary.

 

At this time, the database-independent description of the table in the ABAP Dictionary is translated into the language of the database system used.

 

The database table has the same name as the table in the ABAP Dictionary. The fields also have the same name in both the database and the ABAP Dictionary. The system converts the data types in the ABAP Dictionary to the corresponding data types of the database system.

 

The order of the fields in the ABAP Dictionary can differ from the order of the fields in the database. Therefore, you can insert new fields without having to convert the table. When you add a new field, the system adjusts the list of fields by changing the database catalog. This mechanism is called ALTER TABLE.

 

ABAP programs can use a transparent table in the following ways:

 

You can also create a structured type in the ABAP Dictionary for which there is no corresponding object in the database. Such types are called structures. Structures can also define the types of variables.