Database tables in the ABAP Dictionary
Play the video to learn about database tables in the ABAP Dictionary.
This is a database table definition in the ABAP Dictionary. You can see the name of the DB table after the key word define table, and the names of the table fields on the left of the colons (:). You find the field types on the right of the colons.
In this example, the first field (field client) is typed with a predefined type directly (type abap.clnt). This is possible in general, but you should only use it for purely technical fields like the client field. For all other fields, it is recommended that you reference a data element so that the fields are linked to semantic information, too.
A data element specifies the technical and semantic properties of a table field. When you display a data element, you find the technical type definition on the left, and semantic information (field labels) on the right.
In this example, the technical type is defined through a reference to a domain. This is the recommended approach. The basic data type CHAR and the length 3 are not stored in the data element itself, but come from the referenced domain. They are displayed here for reference, and to save you the trouble of navigating into the domain.
The field labels become relevant when fields based on this data element are visible on the user interface (UI). This is true for classical ABAP UI technologies like Screens (also known as Dynpros) and Web Dynpro, as well as for modern programming techniques like the ABAP RESTful application programming model. The main difference between the four field labels on the right is their respective maximum length.
Note
Field labels are subject to translation. They are maintained by the developer in the original language of the object. From there, they can be translated to other languages.The main purpose of a domain is to specify the technical properties of a table field. The domain in this example uses technical type CHAR and sets the length to 3.
Other settings allow you to restrict the value range of fields. We will discuss this in detail in the next section.
Creating a new dictionary object
Play the video to learn how to create a new domain, data element, or any other dictionary object.