Creating Database Tables Flashcards
What is the purpose of a database table definition in the ABAP Dictionary?
The purpose is to represent a table in the database, providing a structured description of its fields and properties.
How do the names of the development object in the ABAP Dictionary and the corresponding database table relate to each other?
They are identical, with the name of the development object matching the name of the database table.
What is the relationship between fields in the ABAP dictionary and columns in the corresponding database table?
Each field in the ABAP dictionary corresponds to a column in the database table, with the names being the same.
What types of dictionary objects are commonly used to describe the properties of table fields?
Data elements are commonly used, often referencing domains for specifying the technical type of the data.
What does a database table definition in the ABAP Dictionary typically include?
It includes the name of the database table, followed by the names of table fields and their corresponding field types.
What is the significance of directly specifying a predefined type for a field in the ABAP Dictionary?
Directly specifying a predefined type is suitable for purely technical fields like the client field. However, it is recommended to reference a data element for other fields to link them to semantic information.
What does a data element specify in the ABAP Dictionary?
A data element specifies both the technical and semantic properties of a table field.
What is the recommended approach for defining the technical type of a data element?
The recommended approach is to define the technical type through a reference to a domain.
When are field labels relevant in the ABAP Dictionary, and what is their purpose?
Field labels are relevant when fields based on the data element are visible on the user interface (UI). They provide semantic information and enhance user understanding of the data.
What is the main purpose of a domain in the ABAP Dictionary?
The main purpose of a domain is to specify the technical properties of a table field.
What technical properties are defined by the domain in the given example?
The domain specifies the technical type CHAR and sets the length to 3.
What are the steps to create a domain in the ABAP Dictionary?
- From the menu bar, choose File, New, Other.
2- Select ABAP Repository Object and choose Next. - Choose Domain and choose Next.
- Select the desired package and choose OK.
- Fill in the Name and Description and choose Next.
- Select the required transport request and choose Finish.
What settings can you configure when creating a domain?
When creating a domain, you can set the data type, length, and decimals.
What is the difference between defining a domain with types DEC, QUAN, and CURR in the ABAP Dictionary compared to using type P in ABAP?
In ABAP, the number specified in TYPE P LENGTH n refers to the number of bytes, while in the ABAP Dictionary, the number directly indicates the number of digits.
Additionally, in ABAP, a data object of type P always occupies a whole number of bytes, resulting in an odd number of digits, whereas in the ABAP Dictionary, if the length is even, the data objects will be upgraded to the next whole number of bytes.
What is the recommendation regarding the length of domains with types DEC, QUAN, and CURR in the ABAP Dictionary?
It is recommended to aim for odd values for the length of domains with types DEC, QUAN, and CURR to avoid inconsistencies and memory waste.
What are the two places where you maintain texts in a data element?
You maintain texts in a data element in three labels and a heading on the Field Labels section, and in a description on the Properties view.
Why is it recommended to keep the suggested lengths for labels and headings when creating a new data element?
Various frameworks, mostly UI techniques, use the labels and headings to provide semantic metadata for fields. Keeping the suggested lengths ensures consistency and compatibility with these frameworks.
What is the purpose of the description field in a data element?
The description field in a data element provides additional semantic information to developers who analyze existing code or consider reusing the data element. It is not meant for end users.
What are the three parts of a database table definition in ABAP?
Semantic Table Attributes: Annotations starting with the @ sign, defining semantic table attributes.
Define Table Statement: Specifies the name of the database table.
Field List: Contains the list of fields in the table, with each field definition consisting of a field name and a field type separated by a colon.
What is the recommended approach when editing the field list of a database table in ABAP?
It is recommended to use data elements. If the data element already exists, you can start typing its name after the colon sign, then press Ctrl + Enter to see a list of matching data elements.
What should you do if there is no existing data element that you want to use when editing the field list of a database table in ABAP?
Use a quick fix to create a new data element. If the entered type name doesn’t match an existing data element, an error message appears with a quick fix option. (ctrl + 1)
What is the primary key in a database table, and how is it defined in ABAP?
The primary key uniquely identifies a table row and consists of key fields. In ABAP, you mark fields as key fields by adding the “key” keyword in front of their names in the table definition.
What does a null value signify in a database, and how does ABAP handle null values?
A null value indicates undefined or missing data in a database. ABAP replaces nulls with type-specific initial values.
What is the current significance of the “NOT NULL” addition in ABAP?
While still mandatory for key fields, “NOT NULL” doesn’t have a significant effect anymore. The ABAP Dictionary now enforces type-specific initial values for most fields, regardless of the presence of “NOT NULL”.