Creating Database Tables Flashcards

1
Q

What is the purpose of a database table definition in the ABAP Dictionary?

A

The purpose is to represent a table in the database, providing a structured description of its fields and properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do the names of the development object in the ABAP Dictionary and the corresponding database table relate to each other?

A

They are identical, with the name of the development object matching the name of the database table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the relationship between fields in the ABAP dictionary and columns in the corresponding database table?

A

Each field in the ABAP dictionary corresponds to a column in the database table, with the names being the same.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What types of dictionary objects are commonly used to describe the properties of table fields?

A

Data elements are commonly used, often referencing domains for specifying the technical type of the data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does a database table definition in the ABAP Dictionary typically include?

A

It includes the name of the database table, followed by the names of table fields and their corresponding field types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the significance of directly specifying a predefined type for a field in the ABAP Dictionary?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does a data element specify in the ABAP Dictionary?

A

A data element specifies both the technical and semantic properties of a table field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the recommended approach for defining the technical type of a data element?

A

The recommended approach is to define the technical type through a reference to a domain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When are field labels relevant in the ABAP Dictionary, and what is their purpose?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the main purpose of a domain in the ABAP Dictionary?

A

The main purpose of a domain is to specify the technical properties of a table field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What technical properties are defined by the domain in the given example?

A

The domain specifies the technical type CHAR and sets the length to 3.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the steps to create a domain in the ABAP Dictionary?

A
  1. From the menu bar, choose File, New, Other.
    2- Select ABAP Repository Object and choose Next.
  2. Choose Domain and choose Next.
  3. Select the desired package and choose OK.
  4. Fill in the Name and Description and choose Next.
  5. Select the required transport request and choose Finish.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What settings can you configure when creating a domain?

A

When creating a domain, you can set the data type, length, and decimals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the recommendation regarding the length of domains with types DEC, QUAN, and CURR in the ABAP Dictionary?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the two places where you maintain texts in a data element?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Why is it recommended to keep the suggested lengths for labels and headings when creating a new data element?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the purpose of the description field in a data element?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the three parts of a database table definition in ABAP?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the recommended approach when editing the field list of a database table in ABAP?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

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?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the primary key in a database table, and how is it defined in ABAP?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What does a null value signify in a database, and how does ABAP handle null values?

A

A null value indicates undefined or missing data in a database. ABAP replaces nulls with type-specific initial values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the current significance of the “NOT NULL” addition in ABAP?

A

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”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

When does the ABAP editor automatically add the “NOT NULL” flag to key fields?

A

During activation, if the “NOT NULL” flag is missing for a key field, the ABAP editor automatically adds it to ensure data integrity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is the requirement for database table definitions containing amount fields?

A

Amount fields, based on predefined type CURR, require a reference to a currency code field, typically based on predefined type CUKY.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

How is the reference to the currency code field defined for amount fields in a database table definition?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Can the currency code field referenced by the amount field be located in a different database table?

A

While usually located in the same table, it is possible to reference a currency code field in another database table as well.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

How can you define table properties in a database table definition?

A

Table properties can be defined using annotations and technical table settings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What are annotations in the context of table properties?

A

Annotations are code lines starting with the @ sign that define technical and semantic properties of the table within the table definition itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

How can you access the Technical Table Settings editor?

A

Right-click anywhere in the database table definition and choose “Open Others → Technical Settings” to access the Technical Table Settings editor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is the purpose of the “Data Class” setting in the Technical Table Settings?

A

The “Data Class” setting is used to specify the category of data for the table, but its effect is only applicable to Oracle databases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What is the significance of the “Size Category” setting in the Technical Table Settings?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

In what scenarios should the “Column Store” storage type be used for SAP HANA databases?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is the purpose of the “Load Unit” setting in the Technical Table Settings for SAP HANA databases?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What are the three sections in the Technical Table Settings dialog?

A

The three sections are “General Settings,” “Buffering,” and “Data Changes.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What is the purpose of the “General Settings” section in the Technical Table Settings dialog?

A

The “General Settings” section is used to influence how the table is created on the database, although the effect of certain settings may vary depending on the database system.

38
Q

How does the “Buffering” section in the Technical Table Settings dialog impact database table access?

A

The “Buffering” settings determine whether buffering a dictionary database table is allowed in the table buffer of an Application Server instance, affecting how the table is accessed using ABAP SQL.

39
Q

What does the “Data Changes” section in the Technical Table Settings dialog control?

A

The “Data Changes” section controls logging of any changes to table entries made in ABAP SQL, with activated logging directing these changes to the log table DBTABLOG.

40
Q

What is an include structure in the context of database tables?

A

An include structure allows you to add an entire subset of fields to the field list of a database table by referencing a structure development object.

41
Q

How do you define an include structure?

A

To define an include structure, first create a development object of type Structure with the desired fields. Then, in the field list of the database table definition, use the statement INCLUDE followed by the name of the structure to add its fields to the table.

42
Q

What is a common use case for include structures?

A

A common use case for include structures is in data models where multiple database tables need to contain the same subset of fields with identical types, ensuring consistency across tables.

43
Q

How does referencing an include structure affect the database table?

A

Referencing an include structure adds the fields defined in the structure to the field list of the database table at the position of the INCLUDE statement, without copying the fields themselves. Any changes made to the included structure’s field list will immediately update the field list of the database table.

44
Q

What is the purpose of database table adjustment?

A

Database table adjustment is necessary to apply changes in the ABAP Dictionary to the corresponding database table, ensuring consistency between the data model and the database structure.

45
Q

What are the three approaches for adjusting a database table?

A

The three approaches for adjusting a database table are ALTER TABLE, Delete and Create, and Table Conversion.

46
Q

When is the Delete and Create approach suitable for adjusting a database table?

A

The Delete and Create approach is suitable when the table is empty or when the data stored in the table is redundant, as it involves deleting the existing database object and creating a new one based on the changed definition.

47
Q

What is involved in the Table Conversion approach for adjusting a database table?

A

In the Table Conversion approach, a new table is created with a different name, data is copied from the old table to the new one, possibly converting it in the process, and then the old table is deleted and the new one is renamed to replace it.

48
Q

How can you access more details about activation errors in the ABAP Dictionary?

A

You can right-click anywhere on the source code and choose “Open With” → “Dictionary Log” to see more details about activation errors.

49
Q

What are the two quick fixes available for adjusting and activating a database table?

A

The two quick fixes are “Adjust and activate database table, convert data” and “Adjust and activate database table, delete data.”

50
Q

What information does the DB Adjusting Log provide?

A

The DB Adjusting Log contains detailed information on how the table was adjusted during the conversion process, including the start time of the last adjustment and a link to the detailed log.

51
Q

What are some examples of indirect changes that may require adjustments to database tables?

A

Indirect changes include changes to the basic type of a domain, replacement of the domain used in a data element, and changes to the include structure referenced by a database table.

52
Q

What happens when a dictionary object is activated and affects a database table?

A

If a dictionary object affects a database table, the activation process stops with an error message indicating that the domain cannot be activated due to dependent tables.

53
Q

What should you do after adjusting all dependent tables manually?

A

After adjusting all dependent tables manually, you should ensure that the dictionary object you changed directly is in an active status.

54
Q

You change the definition of a database table. In which of the following scenarios do you have to manually adjust the database table?

A
The database table is empty and you added a table field

B
The database table contains data and you deleted a table field.

C
The database table is empty and you deleted a table field.

D
The data base table contains data and you added a table field.

A

B
The database table contains data and you deleted a table field.

You are right. A manual table adjustment is only required when there is a danger of data loss, that is, when the table contains data and you deleted a table field.

55
Q

Which of the following dictionary types are mapped to ABAP data type P (packed number)?

A
CURR

B
CLNT

C
DEC

D icon
CUKY

A

A
CURR

C
DEC

You are right. Only dictionary types DEC, QUAN, and CURR are mapped to ABAP type P.

56
Q

You define a database table in the ABAP Dictionary. What is needed to make the database table client dependent?

A
A key field of type CLNT

B
A corresponding setting in the Technical Table Properties.

C
Annotation @ABAPCatalog.clientDependent: true

A

A
A key field of type CLNT

You are right. A database table is client dependent if it has a key field of type CLNT.

57
Q

What types of dictionary objects can serve as data types for variables and method parameters?

A

Data Elements, Database Tables, and Structures can serve as data types for variables and method parameters.

58
Q

Can domains be used as data types?

A

No, domains cannot be used as data types. They are only used as the foundation for data elements.

59
Q

What is the nature of a database table when used as a data type?

A

When used as a data type, a database table is considered a structure type.

60
Q

What is the recommended approach for defining new data types in ABAP?

A

It is recommended to avoid defining new dictionary objects solely as data types. Instead, use types defined in global classes and interfaces, which offer better visibility and context.

61
Q

Can all data elements be used as data types?

A

Yes, all data elements can be used as data types, except for data elements with a reference type and those that directly use a predefined type.

62
Q

Why are data elements with a reference type not allowed in database table definitions?

A

It is technically not possible to type the field of a database table with a reference type, hence data elements with a reference type cannot be used in database table definitions.

63
Q

What is the recommended practice regarding the use of data elements with predefined types in database table definitions?

A

It is strongly recommended to use data elements that refer to a domain rather than those that directly use a predefined type in database table definitions.

64
Q

How can dictionary structures be used in the ABAP dictionary?

A

Dictionary structures can be used as data types in the ABAP dictionary, defining a collection of related components.

65
Q

What are the components of a dictionary structure?

A

The components of a dictionary structure can include references to data elements, predefined dictionary types, or even other structures.

66
Q

Are dictionary structures compatible with ABAP code-defined structures?

A

Yes, dictionary structures and ABAP code-defined structures are fully compatible as long as they have the same components and types. They can be used interchangeably in ABAP code.

67
Q

How can you define a nested structure in the ABAP Dictionary?

A

To define a nested structure in the ABAP Dictionary, you can include another structure type within the definition of the main structure.

68
Q

What is the difference between nested structures and included structures?

A

Nested structures contain other structures directly within their definition, while included structures reference another structure type to add its components to the field list of the main structure.

69
Q

Can you define nested structures using ABAP code?

A

Yes, nested structures can also be defined using the TYPES statement in ABAP code, similar to how they are defined in the ABAP Dictionary.

70
Q

What is a named include in ABAP?

A

A named include in ABAP is when you include a structure into another structure and give the include a specific name, allowing you to access the fields of the included structure both directly and through the name of the include.

71
Q

How do you define a named include in the ABAP Dictionary?

A

In the ABAP Dictionary, you add the name before the keyword INCLUDE and separate them with a colon (:).

72
Q

How can you access fields within a named include?

A

Fields within a named include can be accessed either directly or through the name of the include followed by a hyphen and the field name.

73
Q

What is a dictionary table type in ABAP?

A

A dictionary table type in ABAP is a data type defined in the ABAP Dictionary that represents the structure of an internal table.

74
Q

How is a dictionary table type created in the ABAP Dictionary?

A

In the ABAP Dictionary, a dictionary table type is created using a form-based editor. It consists of four sections: General Attributes, Row Type, Table Access Category, and Primary Key.

75
Q

What is specified in the Row Type section of a dictionary table type?

A

In the Row Type section of a dictionary table type, the structure of the rows contained within the internal table is specified.

76
Q

What is specified in the Table Access Category section of a dictionary table type?

A

In the Table Access Category section of a dictionary table type, the access type of the internal table is specified, such as Standard, Sorted, Sorted Unique, or Hashed.

77
Q

What is specified in the Table Access Category section of a dictionary table type?

A

In the Table Access Category section of a dictionary table type, the access type of the internal table is specified, such as Standard, Sorted, Sorted Unique, or Hashed.

78
Q

How is the primary key defined in a dictionary table type?

A

The primary key in a dictionary table type is defined in the Primary Key section using the WITH addition, specifying the primary key fields.

79
Q

What options are available for defining the row type of a dictionary table type in ABAP?

A

There are several options for defining the row type of a dictionary table type:

Dictionary Type: Specifies the row type through another dictionary object, often a structure.

Predefined Type: Uses a predefined type as the row type.

Reference to: Specifies a reference type as the row type, containing a list of references.

Range Table on: Defines the type of a ranges table, typically with columns for OPTION, SIGN, LOW, and HIGH.

80
Q

What is the most common way to specify the row type of a dictionary table type?

A

The most common way is to specify the row type through another dictionary object, typically a structure.

81
Q

What is the caution associated with using table types as row types for dictionary table types?

A

While table types may be offered as options for defining the row type, it is not meaningful to use them because the resulting “Table of Tables” can be difficult to handle, lacking a straightforward way to identify rows. It’s recommended to use structures with table-like components instead.

82
Q

What are the options available for the access category when defining a table type in the ABAP dictionary?

A

Options include Standard Table, Sorted Table, and Hashed Table.

83
Q

How is the primary key defined for a table type in the ABAP dictionary?

A

It can be defined using options like Standard Key, Row Type, Not Specified, or Key Components.

84
Q

What is the purpose of a named include in a structure definition in ABAP?

A

It allows creating a field group within the structure for accessing included fields directly or through the named include.

85
Q

What is the difference between a dictionary type and a predefined type when defining the row type of a table type?

A

A dictionary type provides additional semantics and properties, while a predefined type lacks these features.

86
Q

When defining a dictionary table type, what is the significance of the primary key options?

A

They specify how the primary key is determined, such as using the standard key, row type, specific key components, or not specifying a primary key at all.

87
Q

What is a nested table type?

A

It’s a table type where the row type itself is a structure type containing a table-like component.

88
Q

How is a table type used to type the component of a structure type in ABAP?

A

By specifying the table type in the structure definition, the component can contain a nested internal table.

89
Q

What is the significance of using a structure with a table-like component as the row type of another table type?

A

It creates a nested table type, where each row of the outer table contains an internal table as a component, allowing for a hierarchical data structure.

90
Q

In an ABAP class, you work with a structured data object struct. The structure type of struct contains a named include %tky and the included structure contains a component airlineid. Which of the following statements leads to a syntax error?

A
none

B
both

C
struct-airlineid = ‘LH’.

D
struct-%tky-airlineid = ‘UA’.

A

A
none

You are right. Both statements are correct if %tky is a named include.

91
Q

An ABAP class defines an attribute with the following statement: DATA the_attribute TYPE /DMO/AGENCY. Dictionary object /DMO/AGENCY is a database table definition. What kind of data object is the_attribute?

A
Structure

B
Internal table

C
Elementary field

A

A
Structure

You are right. When used in ABAP code, database table definitions are structure types.

92
Q

You define a dictionary table type with a dictionary type as row type. When does the resulting internal table have columns that you can address with column names?

A
When the row type is a table type

B
When the row type is a database table

C
When the row type is a data element

D
When the row type is a structure

A

B
When the row type is a database table

D
When the row type is a structure

You are right. When the row type is a structure or a database table, the resulting internal table has one or more columns with column names.