Defining Basic CDS Views Flashcards

1
Q

How do you create a new data definition in ABAP?

A

Right-click on the project in the Project Explorer, choose “New → ABAP Repository Object”, select “Core Data Services → Data Definitions” from the list, then proceed with entering the package name, data definition name, and description.

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

Is there a shortcut for creating a new data definition if the package already contains one?

A

Yes, you can simply right-click on “Data Definitions” under the Core Data Services node in the Project Explorer, then select “New Data Definition”.

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

How can you choose a template for a new data definition in ABAP?

A

When creating a new data definition, you can select a template from a list of available options. If you want to choose a template later, you can go to the Templates tab in the editor window.

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

What does the FROM clause specify in a CDS view?

A

The FROM clause in a CDS view specifies the data sources from which the view reads data. These can include database tables and other CDS views.

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

Why is it recommended to define a key for a CDS view?

A

Defining a key for a CDS view is recommended because it helps improve performance and ensures data integrity. Without a key, the view may not function as expected, and it may also trigger warnings during syntax checks.

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

How can you insert all elements of a data source into a CDS view’s element list?

A

You can press Ctrl + Space and choose “Insert all elements” to automatically add all fields of the data source (except for the client field) to the element list of the CDS view.

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

How can you format the DDL source code of a data definition for better readability?

A

You can format the DDL source code of a data definition by placing the cursor somewhere in the definition and choosing “Source Code → Format” from the Eclipse menu, or by pressing Ctrl + F1. Additionally, you can define custom formatter profiles in the Eclipse Preferences dialog under “DDL Formatter”.

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

What are ABAP annotations in the context of CDS views?

A

ABAP annotations are annotations that define technical and semantic attributes of a CDS object. They are evaluated during activation or when the object is used in the ABAP runtime environment, and they can modify the behavior of ABAP SQL statements accessing the CDS object.

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

What is the difference between ABAP annotations and framework-specific annotations?

A

ABAP annotations are evaluated during activation or runtime and modify the behavior of ABAP SQL statements. Framework-specific annotations, on the other hand, define properties required by specific software components like ODATA, UI, or Analytics, and they are evaluated by the corresponding frameworks using suitable APIs.

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

How many groups of annotations are there, and what are they?

A

There are five groups of annotations based on their scope:

Entity annotations: Applied to CDS views and entities.

Element annotations: Applied to elements of the SELECT list of a CDS view.

Parameter annotations: Applied to parameters of a CDS view.

Extension annotations: Applied to CDS view extensions.

Function annotations: Applied to CDS table functions.

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

What is the purpose of the AbapCatalog.dataMaintenance annotation?

A

The AbapCatalog.dataMaintenance annotation is used to restrict data preview for a CDS view entity.

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

What does the ABAPCatalog.viewEnhancementCategory annotation specify?

A

The ABAPCatalog.viewEnhancementCategory annotation specifies how the view entity is extended using CDS view extensions. It accepts a comma-separated list of values in the square brackets of the annotation array.

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

What does the AccessControl.authorizationCheck annotation define?

A

The AccessControl.authorizationCheck annotation defines the implicit access control when ABAP SQL is used to access the CDS view.

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

How can the AbapCatalog.entityBuffer.definitionAllowed annotation be used?

A

The AbapCatalog.entityBuffer.definitionAllowed annotation can be used to enable or disable table buffering for a CDS view entity.

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

What is the purpose of the @Semantics.amount.currencyCode annotation?

A

The @Semantics.amount.currencyCode annotation is used to link amount elements (predefined dictionary type CURR) to a currency code element (predefined dictionary type CUKY) in CDS view entities.

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

When is it mandatory to use the @Semantics.quantity.unitOfMeasure annotation?

A

It is mandatory to use the @Semantics.quantity.unitOfMeasure annotation to link quantity elements (predefined dictionary type QUAN) to a unit element (predefined dictionary type UNIT) in CDS view entities.

17
Q

What do ABAP annotations starting with EndUserText define?

A

ABAP annotations starting with EndUserText are used to define translatable semantic texts for CDS objects.

18
Q

How can you open the Active Annotations view?

A

You can open the Active Annotations view by right-clicking on the Data Definition (either in the editor window or in the Project Explorer) and choosing “Open With → Active Annotations.”

19
Q

What are some reasons for building views on top of other views?

A

Some reasons for building views on top of other views include:

Reuse existing functionality

Avoid redundancies

Support error analysis and maintenance

Overcome limitations in nesting SQL expressions and functions within the same CDS view

Layering of the data model, such as in the ABAP RESTful Programming Model, where consumption views are defined on top of data model views.

20
Q

What is annotation propagation in the context of CDS views?

A

Annotation propagation refers to the inheritance of metadata, specifically element annotations, from a source CDS view entity to a target CDS view entity that reads from the source view. This allows the target view to inherit annotations from the source view, reducing the need to redefine annotations.

21
Q

How can you control annotation propagation in CDS view entities?

A

You can control annotation propagation using the entity annotation @Metadata.ignorePropagatedAnnotations. Setting @Metadata.ignorePropagatedAnnotations: true disables the propagation of element annotations from the source view entity to the target view entity.

22
Q

You define a CDS view entity that reads from another CDS view entity. Which kind of CDS annotations can you inherit from the data source?

A
Element annotations

B
Entity annotations

A

A
Element annotations

That is right. Propagation is only supported for element annotations.

23
Q

Which of the following are correct ways to add a comment in a data definition?

A
//

B
/…/

C

D
//

A

A
//

D
//

24
Q
A