Monday, May 25, 2026

10 Analytical MCQ on CDS Views (mettl style)

 Question 1 (Multi-Select)

A developer converts an older classic CDS View (define view) into a modern CDS View Entity (define view entity). Which of the following structural or syntactic modifications are MANDATORY to prevent compilation errors? (Select TWO correct answers)
  • A. The annotation @AbapCatalog.sqlViewName must be completely removed.
  • B. All target associations must be explicitly converted into eager INNER JOIN statements.
  • C. The selection list must explicitly feature a $projection statement on every column.
  • D. An explicit client field mapping calculation layer (MANDT) must be manually added to the select list.
  • E. Elements in the select list must be separated by commas, and the $projection syntax must be used instead of the view name when referencing fields in associations.
Question 2
Consider the following CDS View definition:
cds
@AbapCatalog.sqlViewName: 'ZIV_ITEMS'
define view ZI_OrderItems
  as select from zorders as o
  association [1..*] to zitems as _Items on o.order_id = _Items.order_id
{
  key o.order_id,
  o.customer,
  _Items
}
Use code with caution.
If a developer executes the Open SQL statement SELECT order_id, customer FROM ZI_OrderItems INTO TABLE @DATA(lt_data)., what is the exact runtime behavior on the SAP HANA database layer?
  • A. A database error occurs because the view fails to provide fields from the associated target table.
  • B. An implicit LEFT OUTER JOIN is immediately executed across both zorders and zitems tables.
  • C. No join is executed at all; the database engine strictly queries the zorders table because the association _Items is not evaluated in the selection.
  • D. A performance bottleneck occurs because the system executes sequential SELECT SINGLE queries for every record in the table structure.
Question 3
You are reviewing a developer's code for a high-volume Fiori application. They have written a path expression filter inside a CDS View selection list as follows:
cds
_SalesPartner[ PartnerRole = 'SP' ].PartnerName as SalesPartnerName
Use code with caution.
What is the technical performance advantage of using this association filter over a standard WHERE clause at the bottom of the CDS view?
  • A. It completely disables client-dependency checks for the target table block.
  • B. It applies the filtering condition locally to the specific join instantiation of _SalesPartner, without restricting or filtering out row records from the primary base table.
  • C. It forces the application layer to cache the partner records inside the frontend web browser memory pool.
  • D. It converts the underlying database framework execution strategy from columnar storage back to row-oriented indexing.
Question 4
An analytical report requires a stable, reusable foundation layer within the S/4HANA Virtual Data Model (VDM) architecture. The view must link directly to the physical database tables, expose master data attributes, and serve as a reliable source of truth.
According to SAP VDM standards, what classification annotations should be applied?
  • A. @VDM.viewType: #CONSUMPTION and @Analytics.query: true
  • B. @VDM.viewType: #BASIC and @Analytics.dataCategory: #DIMENSION
  • C. @VDM.viewType: #COMPOSITE and @Analytics.dataCategory: #CUBE
  • D. @VDM.viewType: #EXTENSION and @AccessControl.authorizationCheck: #NOT_ALLOWED
Question 5
Consider the following CDS View Entity snippet:
cds
define view entity ZI_ProductStock
  as select from zstock
{
  product_id,
  location,
  coalesce( unrestricted_stock, 0 ) + coalesce( blocked_stock, 0 ) as total_stock
}
Use code with caution.
Why is the coalesce function utilized here instead of a simple addition statement (unrestricted_stock + blocked_stock)?
  • A. coalesce automatically converts integer fields into floating-point decimals to prevent memory overflow errors.
  • B. If either unrestricted_stock or blocked_stock contains a database NULL value, a direct addition statement would evaluate to NULL, whereas coalesce safely treats it as 0.
  • C. It encrypts the numerical outcome before storing it inside the local system buffer layer.
  • D. It forces the query optimizer to process the addition on the ABAP application server rather than pushing it down to the database.
Question 6
A team lead needs to separate the business logic of a CDS View from its volatile SAP Fiori UI metadata layout rules (such as @UI.lineItem and @UI.selectionField positional rules).
What is the most efficient architectural strategy to achieve this without modifying the core data view?
  • A. Encapsulate the entire CDS layout logic within an AMDP class execution pipeline.
  • B. Add the annotation @Metadata.allowExtensions: true to the core CDS View and define the UI rules inside a separate Metadata Extension (MTE) artifact.
  • C. Build a classic table append structure inside transaction SE11 to capture the layout data.
  • D. Hardcode the UI presentation settings directly inside the Fiori application's frontend JavaScript controller files.
Question 7
Look at the following DCL (Data Control Language) definition securing a CDS View:
dcl
define role ZI_SecuredView {
  grant select on ZI_SecuredView
  where ( AuthorizationField ) = aspect pfcg_auth( Z_BU_AUTH, ACTVT = '03', DUMMY = $session.client );
}
Use code with caution.
If the corresponding CDS View features the annotation @AccessControl.authorizationCheck: #NOT_REQUIRED, what happens when a business user queries the view?
  • A. The query crashes with a short dump because of a direct conflict between the DCL and the view annotations.
  • B. The database enforces strict row-level filtering based on the user's Z_BU_AUTH authorization object permissions.
  • C. The DCL role is completely ignored at runtime, and all data rows are returned to the user without any security checks.
  • D. The system prompts the user with a pop-up window login screen to re-authenticate their active corporate credentials.
Question 8 (Multi-Select)
When executing a modern CDS View Entity that uses input parameters from an ABAP program using Open SQL, which of the following rules are TRUE? (Select TWO correct answers)
  • A. Parameter values must be passed immediately following the view name inside parentheses, separated by commas (e.g., FROM zi_view( p_param1 = 'A', p_param2 = 'B' )).
  • B. Passing parameters from Open SQL is completely blocked; parameters can only be populated when consumed by an OData service.
  • C. Parameters must be passed using individual @ host variable tokens inside a traditional WHERE clause.
  • D. Within the Open SQL statement, any parameter names or host variables passed to the parameterized view must be escaped using the @ symbol.
  • E. The application automatically defaults all missing parameters to space or zero, eliminating syntax checking requirements.
Question 9
What is the functional difference between an Association defined with a cardinality of [0..1] and one defined with [1..*] inside an ABAP CDS View?
  • A. [0..1] can only reference master data tables, whereas [1..*] can only reference transactional data pools.
  • B. [0..1] allows structural scalar path navigation expressions (e.g., _Assoc.FieldName) directly in the select list, whereas [1..*] restricts field selection unless specific aggregations or array rules are applied.
  • C. [1..*] forces the underlying database framework to use row-storage engine mapping natively.
  • D. [0..1] executes on the application server memory pool, whereas [1..*] pushes the data evaluation completely down to the database.
Question 10
A developer attempts to create a CDS View Entity that queries a standard database view. The activation phase fails with a repository error message. What is the root cause of this failure?
  • A. CDS View Entities can only read data from other CDS Views; they cannot read raw database tables or traditional views directly.
  • B. A CDS View Entity is restricted to reading from a maximum of two database tables at any given time.
  • C. The developer failed to provide a corresponding @AbapCatalog.sqlViewName entry in the metadata header panel.
  • D. CDS View Entities cannot use a classic database view (DDIC View) as a data source; they can only select from database tables or other CDS entities.

No comments:

Post a Comment

Search SAPMV45A includes for Constants and Statics

 This report can find CONSTANTS and STATICS in SAPMV45A Z-includes. We know that Constants and Statics consume global variables so identifyi...