ARCHITECTAdvanced
CDS Views
Master ABAP CDS Views with view entities, annotations, associations, joins, parameters, DCL authorization, analytical views, OData exposure and real S/4HANA performance design.
Overview
Master ABAP CDS Views with view entities, annotations, associations, joins, parameters, DCL authorization, analytical views, OData exposure and real S/4HANA performance design.
Lessons in this topic
- CDS Views Part 1: What CDS Is and Your First View EntityUnderstand what Core Data Services (CDS) are, why SAP moved data modelling from SE11 into CDS, how to create a first CDS view entity in Eclipse ADT, and how a classic ABAP report reads from it like a normal table.
- CDS Views Part 2: Joins, Expressions, CASE, CAST and FunctionsBuild CDS views that do real work in the database: inner and left outer joins, WHERE conditions, CASE expressions, CAST to ABAP types, string and date functions, and session variables such as the system date.
- CDS Views Part 3: Aggregation and Analytical AnnotationsAggregate data in CDS with SUM, COUNT, MIN, MAX, AVG and GROUP BY, understand why amounts must be grouped by currency, and see how analytical annotations turn CDS views into cubes and queries for embedded analytics.
- CDS Views Part 4: CDS View Entity vs Classic (DDIC-Based) CDS ViewCompare the classic DDIC-based CDS view (define view with @AbapCatalog.sqlViewName) with the modern CDS view entity (define view entity), understand the technical differences, why view entities are the standard for new work, and how to handle existing classic views.
- CDS Views Part 5: VDM Layering — Basic, Composite and Consumption ViewsUnderstand the Virtual Data Model (VDM) layers used in S/4HANA: basic interface views over single tables, composite views that combine them, and consumption views built for one app or report. Learn naming, the @VDM annotations and how to reuse SAP's released I_ views.
- CDS Views Part 6: Associations and CardinalityModel relations between CDS views with associations instead of hard joins: syntax, ON conditions with $projection, cardinality [0..1], [1..1], [0..*], path expressions, exposing associations to consumers, and the row-multiplication trap.
- CDS Views Part 7: Annotations for Semantics, Texts, Search and UIUse CDS annotations to give data meaning: currency and unit semantics, text views and text associations, language-dependent descriptions, search annotations, UI annotations for Fiori elements, and metadata extensions that keep UI layout out of the data model.
- CDS Views Part 8: DCL Access ControlProtect CDS data with Data Control Language (DCL): access control roles that link CDS fields to PFCG authorization objects, the authorizationCheck annotation values, how ABAP SELECTs are filtered automatically, inheritance between views, and how to test and troubleshoot missing rows.
- CDS Views Part 9: Parameters and FilteringDefine CDS views with input parameters, use $parameters in WHERE, calculations and path filters, default parameters from system fields, and pass parameters from ABAP. Learn when parameters are the right tool and when a simple WHERE by the consumer is better.
- CDS Views Part 10: Performance and TroubleshootingKeep CDS pushdown fast: understand how view stacks become one SQL statement, avoid expensive patterns (functions in joins, to-many paths, early currency conversion, deep stacks, unused joins), and analyse slow views with the SQL CREATE statement, ST05, SQL Monitor, the ADT dependency analyzer and HANA PlanViz.
Interview questions covered
- Data appears wrong in a consumption CDS view. Approach?
- How do you expose a CDS view as OData?
- Legacy report on SE11 views performs badly. Migrate to CDS?
- How would you structure a CDS model for a domain?
- What is the difference between CDS view entity and classic CDS view?
- How do you secure data exposed by CDS Views?
- A CDS-based Fiori app shows duplicate rows. What would you check?
- What is an association in CDS?
- What is DCL?
- What is a CDS View in SAP ABAP?
- What is the difference between a Basic, Composite, and Consumption CDS view?
- Five ABAP reports on your project each join VBAK, VBAP and KNA1 themselves, and their totals do not match. How would you use CDS to fix this?
- A backlog report reads VBAP and VBAK in nested SELECTs and calculates order age and rejection status in ABAP loops. It runs 25 minutes. How would you redesign it with CDS?
- After go-live, a Brazil user sees German sales orders in a custom Fiori app. The CDS view has @AccessControl.authorizationCheck: #CHECK. What happened and how do you fix it?
- A Fiori list report generated from CDS annotations shows amounts without currency and order types only as codes with technical labels. What would you change in the CDS model?
- How would you design CDS views for a Fiori list report?
- How do you add calculated fields to a CDS view, and what do you watch out for with CASE, CAST and date calculations?
- A team built all sales CDS views with parameters for sales org, customer and date range "for performance". Fiori apps now show a parameter dialog and other reports cannot reuse the views. Evaluate the design.
- A sales-order header view has association [1..1] to its items and shows item material in the field list. The totals are doubled. Explain and fix.
- A condition validity report must always evaluate data as of one key date, and the age of each record depends on that date. How would you model this in CDS?