CDS Views
Architect / Cross-trackBeginner

CDS Basics: Why CDS Exists in S/4HANA

Understand why CDS Views became central in S/4HANA reporting, APIs and Fiori apps.

Explanation

CDS Views provide a semantic modeling layer on top of database tables. In classic ABAP, developers often selected data into internal tables, joined manually and calculated results in ABAP. In S/4HANA, CDS helps push filtering, joining, aggregation and semantics closer to the database. CDS is also reusable. The same CDS model can support reporting, Fiori elements, OData services, analytics and RAP applications. A beginner should first understand that CDS is not only a SELECT statement. It is a reusable data model with annotations, associations, semantics and authorization possibilities.

Code example

ABAP Code
@EndUserText.label: 'Sales Order Basic View'define view entity ZI_SalesOrderBasic as select from vbak{ key vbeln as SalesOrder, auart as SalesDocumentType, vkorg as SalesOrganization, erdat as CreatedOn} // Purpose:// This basic CDS view exposes only required sales order header fields.// It becomes reusable for reports, Fiori apps and higher-level composite views.// Keep basic views simple and close to database tables.

Real project scenario

A custom sales dashboard that previously used a slow ALV report was rebuilt using layered CDS views. Filtering and aggregation moved to HANA, and the same consumption CDS was reused in a Fiori elements list report.

Common mistakes

- Thinking CDS is only a replacement for SE11 views. - Creating one CDS for every small report without reuse planning. - Adding too many fields in the first basic view. - Ignoring naming and layering strategy.

Best practices

- Start with small reusable basic views. - Use clear naming like ZI for interface/basic and ZC for consumption. - Expose only required fields. - Think reuse before report-specific design.

Interview angle

A strong answer should explain that CDS provides semantic, reusable, HANA-optimized modeling for S/4HANA apps and analytics.