Skip to content
IT Canvass
SAP examples · Lesson

CDS examples

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.

Want to learn this properly?

Our live, instructor-led SAP Training covers this hands-on, with real projects and a certification path.

Check your understanding

  1. Which statement is true of CDS examples?

    • A. These SAP MCQ (multiple-choice question) banks help you prepare for certification exams and interviews…
    • B. Annotations turn a view into an OData service, an analytical cube, or UI metadata, one model, many uses.
    • C. SAP SRM (Supplier Relationship Management) manages procurement and supplier collaboration, strategic…
    Show answer

    B. Annotations turn a view into an OData service, an analytical cube, or UI metadata, one model, many uses.

    Covered in the “What it teaches” section of this lesson.

  2. Which of these also applies to CDS examples?

    • A. Memorising definitions without understanding the why.
    • B. Layer base and composite views, and push filtering/aggregation down for performance.
    • C. Trying to learn every module at once, depth in one beats shallow breadth.
    Show answer

    B. Layer base and composite views, and push filtering/aggregation down for performance.

    Covered in the “What it teaches” section of this lesson.

  3. Which part of the Learn SAP curriculum covers CDS examples?

    • A. SAP examples
    • B. SAP fundamentals
    • C. SAP integration
    Show answer

    A. SAP examples

    This lesson sits in the SAP examples section of the Learn SAP course.

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.
CallWhatsAppEnquire