ERPClimb logoERPClimb
CDS Views
RAP / CDS / ODatabeginner 11 min read

CDS Views Part 2: Create Your First CDS View Entity in ADT

Preview · a free account unlocks the full lesson

Key takeaway

Create a real ABAP CDS view entity in ADT with keys, aliases, currency semantics and a simple association, then activate and preview the result.

In this lessonShow sections

Visual overview

CDS Views Part 2: Create Your First CDS View Entity in ADT — learning sheetIn one line: Create a real ABAP CDS view entity in ADT with keys, aliases, currency semantics and a simple association, then activate and preview the result.ERPClimb.com / RAP / LESSON 2/4 / LEARNING SHEETCDS Views Part 2: Create Your First CDS View Entity in ADT1 · IN ONE LINECreate a real ABAP CDS view entity in ADT with keys, aliases, currency semantics and asimple association, then activate and preview the result.2 · KEY IDEAS EXPLAINEDStart With The Business QuestionDo not begin with syntax.Choose The Data Sourcesales_ordersales_order_itemCreate The CDS Data Definition In AdtIn ADT:Write The First View EntityA minimal view entity looks like this:3 · DO · AVOIDBest practice!Common mistakeStart with the business dataset, not thesyntax.Prefer released SAP CDS entities and APIs.Keep interface entities stable and reusable.✕Wrong logical key.✕Incorrect association cardinality.✕Direct access to unreleased SAP persistence inclean-core development.4 · IN A REAL PROJECTModel a purchase requisition summary entity exposing requisition number, item, material, plant, quantity andunit from a supported source, then consume it in a higher projection.Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 1 covered why CDS view entities matter.

This lesson builds one from start to finish: a simple sales-order item view called ZI_SalesOrderItem that reads from an illustrative custom source table, exposes clear business field names, defines a stable key, models amount and currency correctly, adds a simple association, activates cleanly in ADT, and ends up ready for reuse in RAP, analytics, or another CDS layer.

The object and field names here are illustrative; in an actual ABAP Cloud or clean-core scenario, released SAP CDS entities should be used instead of direct SAP internal tables.

Beyond knowing the basic purpose of a CDS view entity from Part 1, this requires ABAP Development Tools in Eclipse, a package and a transport, and a system release that supports CDS view entities.

The right starting point is never syntax but the business question: what reusable business dataset is actually being modeled? Here, the answer is a reusable list of sales-order items with order number, item number, customer, material, quantity and net value — and that sentence becomes the design boundary for everything that follows.

For this training example, the data source is an illustrative custom table named zso_item, assumed to contain sales_order, sales_order_item, customer_id, material_id, order_qty, sales_unit, net_amount, currency_code, created_at and last_changed_at. In a real S/4HANA clean-core design, the first move would be to look for a released CDS interface view or released API representing the business object needed, rather than reaching for a custom table.

Creating the CDS data definition in ADT means right-clicking the package, choosing New → Other ABAP Repository Object, searching for Data Definition, entering a name such as ZI_SalesOrderItem, adding a meaningful description, assigning the transport, and choosing a view-entity template if the release provides one. The naming convention shown is only an example — what matters is that a project uses one consistently.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.