Defining Basic CDS Views Flashcards
How do you create a new data definition in ABAP?
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.
Is there a shortcut for creating a new data definition if the package already contains one?
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 can you choose a template for a new data definition in ABAP?
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.
What does the FROM clause specify in a CDS view?
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.
Why is it recommended to define a key for a CDS view?
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 can you insert all elements of a data source into a CDS view’s element list?
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 can you format the DDL source code of a data definition for better readability?
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”.
What are ABAP annotations in the context of CDS views?
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.
What is the difference between ABAP annotations and framework-specific annotations?
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 many groups of annotations are there, and what are they?
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.
What is the purpose of the AbapCatalog.dataMaintenance annotation?
The AbapCatalog.dataMaintenance annotation is used to restrict data preview for a CDS view entity.
What does the ABAPCatalog.viewEnhancementCategory annotation specify?
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.
What does the AccessControl.authorizationCheck annotation define?
The AccessControl.authorizationCheck annotation defines the implicit access control when ABAP SQL is used to access the CDS view.
How can the AbapCatalog.entityBuffer.definitionAllowed annotation be used?
The AbapCatalog.entityBuffer.definitionAllowed annotation can be used to enable or disable table buffering for a CDS view entity.
What is the purpose of the @Semantics.amount.currencyCode annotation?
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.