SAP examples · LessonBy Anitha M, SAP Trainer, 13 yrs · Published · SAP S/4HANA 2023 · all levels
CDS examples
These CDS examples show Core Data Services views, the modern SAP modeling layer, with joins, associations, aggregation and annotations that expose data to Fiori and analytics.
Quick answer
CDS models data close to the database with reusable, annotated views.
Key takeaways
- Watch out: Ignoring annotations that unlock OData/analytics.
- Worked examples: a cds view with an association, aggregation and annotations, what it teaches.
- How CDS examples fits into SAP development and the wider SAP landscape
A CDS view with an association
define view entity Z_SalesDoc as select from vbak
association [1..*] to vbap as _Item on vbak.vbeln = vbap.vbeln
{
key vbak.vbeln,
vbak.kunnr,
_Item
}Aggregation and annotations
@Analytics.dataCategory: #CUBE
@OData.publish: true
define view entity Z_Sales_Cube as select from I_SalesOrderItem {
key SoldToParty,
@Aggregation.default: #SUM
NetAmount
}What it teaches
CDS models data close to the database with reusable, annotated views. Annotations turn a view into an OData service, an analytical cube, or UI metadata, one model, many uses. Layer base and composite views, and push filtering/aggregation down for performance.
Common pitfalls
- Ignoring annotations that unlock OData/analytics.
- Monolithic views.
- Late aggregation hurting performance.
Practice challenge
+0 XPStreak ×0
Question 1 of 3
Which statement is true of CDS examples?
Frequently asked questions
What does the term CDS examples refer to in SAP?
These CDS examples show Core Data Services views, the modern SAP modeling layer, with joins, associations, aggregation and annotations that expose data to Fiori and analytics.
What is worth remembering about CDS examples in practice?
CDS models data close to the database with reusable, annotated views.
What tends to go wrong with CDS examples?
Ignoring annotations that unlock OData/analytics. Monolithic views. Late aggregation hurting performance.