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”.
When does the ABAP editor automatically add the “NOT NULL” flag to key fields?
During activation, if the “NOT NULL” flag is missing for a key field, the ABAP editor automatically adds it to ensure data integrity.
What is the requirement for database table definitions containing amount fields?
Amount fields, based on predefined type CURR, require a reference to a currency code field, typically based on predefined type CUKY.
How is the reference to the currency code field defined for amount fields in a database table definition?
The reference is defined using the annotation @Semantics.amount.currencyCode before the amount field. The argument of the annotation contains the name of the table and the name of the currency code field separated by a period.
Can the currency code field referenced by the amount field be located in a different database table?
While usually located in the same table, it is possible to reference a currency code field in another database table as well.
How can you define table properties in a database table definition?
Table properties can be defined using annotations and technical table settings.
What are annotations in the context of table properties?
Annotations are code lines starting with the @ sign that define technical and semantic properties of the table within the table definition itself.
How can you access the Technical Table Settings editor?
Right-click anywhere in the database table definition and choose “Open Others → Technical Settings” to access the Technical Table Settings editor.
What is the purpose of the “Data Class” setting in the Technical Table Settings?
The “Data Class” setting is used to specify the category of data for the table, but its effect is only applicable to Oracle databases.
What is the significance of the “Size Category” setting in the Technical Table Settings?
The “Size Category” setting affects the size of the initial memory area reserved for the table on the database, with values between 0 and 9 assigned to intervals of expected rows.
In what scenarios should the “Column Store” storage type be used for SAP HANA databases?
The “Column Store” storage type should be used for tables designed for application data analyzed in SAP HANA, tables containing a large number of rows for better compression, or tables containing fields with SAP HANA data types only supported by the column store.
What is the purpose of the “Load Unit” setting in the Technical Table Settings for SAP HANA databases?
The “Load Unit” setting specifies how the data of the table is loaded into the main memory of the SAP HANA database, with options for “Column Loadable” or “Page Loadable” depending on the table’s characteristics and access patterns.
What are the three sections in the Technical Table Settings dialog?
The three sections are “General Settings,” “Buffering,” and “Data Changes.”