CDS Views Part 1: What CDS Is and Your First View Entity
Understand 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.
What this complete series covers
Learn CDS Views in a clear, practical sequence — from the basic idea to real project use, troubleshooting, and interview-ready understanding.
- Who it is for
- Best for SAP consultants, developers, and learners who want a practical understanding of CDS Views.
- Prerequisites
- Some SAP project experience is helpful because the series connects architecture decisions across applications, integration, clean core, data, and operations.
- Final outcome
- By the end, you should be able to explain CDS Views clearly, follow the main end-to-end flow, apply it in a project scenario, and troubleshoot the most common issues.
- Part 1: CDS Views Part 1: What CDS Is and Your First View Entity
Understand ABAP CDS as a semantic data-modeling layer for S/4HANA that pushes set processing to the database while exposing reusable business entities for reports, analytics, APIs and Fiori.
- Part 2: CDS Views Part 2: Joins, Expressions, CASE, CAST and Functions
Model reusable ABAP CDS view entities with explicit semantics, associations, annotations and stable business keys instead of treating CDS as a thin SQL view.
- Part 3: CDS Views Part 3: Aggregation and Analytical Annotations
Secure CDS data with DCL and design analytical annotations deliberately, understanding that authorization, analytical semantics and UI metadata solve different concerns.
- Part 4: CDS Views Part 4: CDS View Entity vs Classic (DDIC-Based) CDS View
Prefer CDS view entities for new development on supported ABAP platforms while maintaining existing classic CDS views where they remain stable, understanding the differences in DDI
- Part 5: CDS Views Part 5: VDM Layering — Basic, Composite and Consumption Views
Layer CDS models by responsibility so reusable interface views define stable business semantics, composite views combine or aggregate them, and consumption or projection views shap
- Part 6: CDS Views Part 6: Associations and Cardinality
Use CDS associations to model reusable relationships and declare cardinality from real data semantics, because incorrect cardinality can mislead consumers and affect generated query behavior.
- Part 7: CDS Views Part 7: Annotations for Semantics, Texts, Search and UI
Use CDS annotations to add consumer-relevant semantics such as currency, units, labels, UI hints and analytical meaning while keeping reusable data models free from unnecessary pre
- Part 8: CDS Views Part 8: DCL Access Control
Use CDS DCL for row-level read authorization on CDS entities, test it with restricted users and keep modification authorization in the transactional layer rather than assuming DCL
- Part 9: CDS Views Part 9: Parameters and Filtering
Use CDS parameters for mandatory semantic inputs such as key date or scenario selection, while leaving ordinary optional restrictions to consumer filters when that keeps the model more reusable.
- Part 10: CDS Views Part 10: Performance and Troubleshooting
Design CDS for selective set processing rather than giant all-purpose views: project only required fields, keep joins and associations semantically justified, push aggregation wher
System and release assumptions: Architecture guidance is release-aware and clean-core oriented. Exact product capabilities and supported extension points should be checked against the target SAP release.
Explanation
📌 KEY POINTS
✅ CDS (Core Data Services) is SAP's language for defining data models in the database layer: views with joins, calculations, associations, annotations and authorizations.
✅ CDS views are created in Eclipse ADT (not SE11/SE80) as DDL sources; the recommended type today is the CDS view entity (define view entity).
✅ A classic ABAP report reads a CDS view with a normal SELECT — the view is just another data source.
⚠️ CDS is the foundation of S/4HANA: Fiori apps, analytics, RAP and OData all sit on CDS. An ABAP developer who cannot read CDS cannot work on S/4 projects.
━━━━━━━━━━━━━━━━━━━━
▶ WHAT THIS SERIES COVERS
- Part 1: What CDS is and your first view entity
- Part 2: Joins, expressions, CASE, CAST and built-in functions
- Part 3: Aggregation and analytical annotations
- Part 4: CDS view entity vs classic (DDIC-based) CDS view
- Part 5: VDM layering: basic, composite and consumption views
- Part 6: Associations and cardinality
- Part 7: Annotations for semantics, texts, search and UI
- Part 8: DCL access control
- Part 9: Parameters and filtering
- Part 10: Performance and troubleshooting
━━━━━━━━━━━━━━━━━━━━
▶ 1. WHY CDS EXISTS
- SE11 database views only support inner joins and simple projections — no calculations, no unions, no aggregation, no reusable relations.
- On HANA, SAP wants logic pushed to the database ("code pushdown"). CDS lets you define that logic once, in the database, reusable by reports, Fiori apps and APIs.
- S/4HANA itself is modelled in CDS: I_SalesOrder, I_Product, I_JournalEntry and thousands more (the Virtual Data Model, VDM).
━━━━━━━━━━━━━━━━━━━━
▶ 2. WHERE YOU CREATE IT
- Eclipse with ABAP Development Tools (ADT): right-click package → New → Other ABAP Repository Object → Core Data Services → Data Definition.
- Choose the template "Define View Entity".
- Activate with Ctrl+F3. The view is stored in the ABAP repository and created in the database on activation.
- SE11/SE80 can display CDS names but cannot edit them.
━━━━━━━━━━━━━━━━━━━━
▶ 3. ANATOMY OF A VIEW ENTITY
- Header annotations (@EndUserText.label, @AccessControl.authorizationCheck).
- define view entity <name> as select from <data source>.
- Field list in curly brackets; key fields marked with key and listed first.
- Aliases (as SalesOrder) give business names in CamelCase instead of technical names like VBELN.
- Amount and quantity fields need a reference to their currency/unit field (@Semantics annotations) — view entities enforce this.
━━━━━━━━━━━━━━━━━━━━
▶ 4. NAMING CONVENTIONS
- Customer views start with Z or Y. Common pattern: ZI_ for interface (basic/composite) views, ZC_ for consumption views (Part 5).
- Name length max 30 characters; use business names, not table names.
━━━━━━━━━━━━━━━━━━━━
▶ 5. READING CDS FROM CLASSIC ABAP
- SELECT … FROM zi_salesorderheader works like reading a table.
- Use the alias names (salesorder, creationdate), not the original table fields.
- Client handling is automatic — the current client is applied, as for normal tables.
━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP
- Open ADT, create a Data Definition ZI_SALESORDERHEADER with template "Define View Entity".
- Select from VBAK, expose VBELN (key), ERDAT, AUART, VKORG, KUNNR, NETWR, WAERK with business aliases.
- Add @Semantics.amount.currencyCode on NetAmount and activate.
- Press F8 in ADT (Data Preview) to see rows.
- Write a classic SE38 report that selects from the view with a date range and lists the result.
✅ CHECKPOINT: you can create a view entity, preview it, and read it from a classic ABAP report.
Code example
// ===== STEP 1: CDS view entity (ADT, DDL source ZI_SALESORDERHEADER) =====@AccessControl.authorizationCheck: #NOT_REQUIRED@EndUserText.label: 'Sales order header - basic'define view entity ZI_SalesOrderHeader as select from vbak{ key vbeln as SalesOrder, erdat as CreationDate, auart as SalesOrderType, vkorg as SalesOrganization, kunnr as SoldToParty, @Semantics.amount.currencyCode: 'TransactionCurrency' netwr as NetAmount, waerk as TransactionCurrency} * ===== STEP 2: classic ABAP report reading the view (SE38) =====REPORT zcds_read_so_header. TYPES: BEGIN OF ty_so, salesorder TYPE vbeln_va, creationdate TYPE erdat, soldtoparty TYPE kunnr, netamount TYPE netwr_ak, transactioncurrency TYPE waerk, END OF ty_so. DATA: lt_so TYPE STANDARD TABLE OF ty_so, ls_so TYPE ty_so, lv_lines TYPE i. SELECT-OPTIONS s_erdat FOR sy-datum. START-OF-SELECTION.* ===== STEP 3: select from the CDS view like a table ===== SELECT salesorder creationdate soldtoparty netamount transactioncurrency FROM zi_salesorderheader INTO TABLE lt_so WHERE creationdate IN s_erdat. DESCRIBE TABLE lt_so LINES lv_lines. WRITE: / 'Orders found:', lv_lines. * ===== STEP 4: output ===== LOOP AT lt_so INTO ls_so. WRITE: / ls_so-salesorder, ls_so-creationdate, ls_so-soldtoparty, ls_so-netamount CURRENCY ls_so-transactioncurrency, ls_so-transactioncurrency. ENDLOOP.Real project scenario
On an S/4HANA conversion, a team kept building SE11 database views and ABAP joins for every new report. Each report re-implemented the same order-header logic with small differences, and totals did not match between reports.
The architect introduced one CDS view entity ZI_SalesOrderHeader with agreed field names and currency references. All new reports and a Fiori list app read from it. Differences between reports disappeared because the logic now existed in one place.
Common mistakes
- Trying to create or change CDS views in SE11/SE80 instead of ADT.
- Using technical field names (VBELN, KUNNR) as aliases — consumers then cannot tell what the field means.
- Forgetting the currency/unit reference for amount or quantity fields (activation error in view entities).
- Selecting with the original table field names from ABAP instead of the CDS alias names.
- Creating a new CDS view for every report instead of reusing an existing one.
Best practices
- Use define view entity for all new CDS development.
- Give every field a clear CamelCase business alias.
- Always add @EndUserText.label and a deliberate @AccessControl.authorizationCheck value.
- Check SAP's standard I_ views first (e.g. I_SalesOrder) before building your own.
- Test with ADT Data Preview (F8) before consuming in ABAP.
Interview angle
Questions: "What is CDS and why did SAP introduce it?", "Where do you create CDS views?", "How do you read a CDS view in ABAP?"
Strong answer: CDS is a database-layer modelling language supporting joins, calculations, associations, annotations and DCL; it enables code pushdown on HANA and is the basis of the S/4 VDM, Fiori, analytics and RAP. Created in ADT as a data definition (define view entity). Consumed from ABAP with a normal SELECT using the alias names; client handling is automatic.
Practice this lesson
Quick check
1. What is the main purpose of CDS in S/4HANA?
2. Which syntax starts a modern CDS view entity?
3. How are key fields designated within the SELECT list of a CDS view entity definition?
Interview questions
1. 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?
Answer it in your own words first, then compare.
2. What is a CDS View in SAP ABAP?
Answer it in your own words first, then compare.
Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.
More lessons in this topic
- CDS Views Part 10: Performance and Troubleshooting
- CDS Views Part 2: Joins, Expressions, CASE, CAST and Functions
- CDS Views Part 3: Aggregation and Analytical Annotations
- CDS Views Part 4: CDS View Entity vs Classic (DDIC-Based) CDS View
- CDS Views Part 5: VDM Layering — Basic, Composite and Consumption Views
- CDS Views Part 6: Associations and Cardinality
- CDS Views Part 7: Annotations for Semantics, Texts, Search and UI
- CDS Views Part 8: DCL Access Control