Data modelling

Defining the shape of data before anything serves it: entities and their types, how they relate, and the projections and views that services and applications consume.

Overview

InCAPassessed

Defining the shape of the data before anything serves it — entities and types, aspects that carry cross-cutting concerns, associations and compositions, and the projections a service exposes. The question every CAP project answers first, and the one the rest of the corpus assumes has been answered.

SAP SHIPS
Node.js →

@sap/cds-compiler Compiles CDS models to CSN, EDMX and database schemas.

@sap/cds Compiles CDL from files or in-memory sources to CSN with cds.compile, and every generic handler reads the model through that CSN at runtime.

Java →

com.sap.cds:cds-services-bom Exposes the CDS model to the application through the Model Reflection API: services, types, entities and their elements, from the event context or injected.

Not covered: It stops at the model itself. Turning CSN into something else — types for a compiler, a picture, a migration against a database that already holds data — is a different capability each time, and each has its own entry here. The guide's own performance advice is part of the answer: avoid UNION in views, model polymorphism as normalised or denormalised entities rather than unions, and keep view chains and joins short, because the compiler translates what the model says and does not optimise it away.

THE COMMUNITY ADDS

CDS plugins that add reusable model parts to a project: cap-user-info ships an aspect and an entity that resolve createdBy and modifiedBy to a user record, and cds-numberrange-plugin adds a counter entity behind an annotated element.

InABAPassessed

Defining the persistent and projected shape of data — and the migration from classic dictionary objects to CDS view entities.

SAP SHIPS

ABAP CDS provides view entities, projections and annotations as the modelling layer above database tables.

SourceSAP Help — ABAP Core Data Serviceschecked
THE COMMUNITY ADDS

Tools around the CDS layer: CDS Analyser indexes a system's CDS views against the tables and fields they expose, CDS field mapping looks up which CDS entity replaced a classic dictionary table and field, and acds parses ABAP CDS source into a typed syntax tree.

Artifacts9

Group by9 of 9 artifacts
ArtifactSignals
Apps1
cdsanalyserMaps database tables and fields to the CDS views exposing them
Signals
Functional boundary
Build tools1
@sap/cds-compilerCompiler from CDS models to CSN, EDMX and database schemas
Signals
none
CDS plugins2
cap-user-infoUser details and quickview links for createdBy and modifiedBy
Signals
none
cds-numberrange-pluginFills a CDS element from a database-backed number range
Signals
none
Packages3
@sap/cdsCAP Node.js runtime
Signals
none
@sap/cds-common-contentISO content for CAP's countries, languages, currencies and timezones
Signals
none
com.sap.cds:cds-services-bomMaven bill of materials pinning CAP Java module versions
Signals
none
Platforms1
ABAP CDSModelling layer of ABAP Cloud above database tables
Signals
Functional boundary
Web tools1
CDS Field MappingMaps classic dictionary tables and fields to CDS entities and fields
Signals
No license+1

Content31

Group by31 of 31 pieces
Piece, what it offers
CDS Associations & Joins
YouTube — SAP Developers playlists, SAP Developers, Talk
052: 10 Minutes from Start to Launchpad
Software-Heroes, Björn S., Blog
Beyond READ_TEXT: Decoding SAPscript Long Texts (STXL) with SQLScript in CDS/AMDP
SAP Community, aamelin1, Blog
Show 28 more
Deep Insert in SAP CAPM Using Composition and Fiori Elements
SAP Community, Talari Hari Kumar, BlogThe reasoningA recipeRunnable code
Calculating IBP Technical Week "Key Figure Date" in S/4HANA Using CDS View
SAP Community, bharatbajaj, Blog
Building an Enterprise Application Using Fiori Elements and CAP - Part 1
SAP Community, Farooq, part 1 of 3, BlogThe reasoning
Create CDS Views and expose through OData service in CAPM
SAP Community, VenkateshMundru, Blog
A CAP Plugin for Flexible Number Range Management: cds-numberrange-plugin
SAP Community, abdulbasit, BlogThe reasoningRunnable code
Understanding Projections in CAPM: Select Only What You Need!
SAP Community, Avisek_, BlogThe reasoning
Generating Adobe Form Using RAP framework OData Services
SAP Community, Megastar, Blog
My CAP Projects Toolbox
SAP Community, vvdries, Blog
SAP Incentive Management - Understanding of CSN file & CLI Command to generate
SAP Community, Yogananda, BlogThe reasoningA recipeRunnable code
CAP, CDS, CDL, CSN and jq - finding associations
SAP Community, DJ Adams, BlogThe reasoning
SAP CAP(Cloud Application Programming)开发框架概述
SAP Community, ArthurYang, Blog
Use Aspects, Association and Convert OData V4 to V2 using Proxy
SAP Community, rahul_rajagopal, BlogThe reasoning
#CAP-TechBytes Input Validation
SAP Community, Thajunniza, BlogThe reasoning
#BTP #SAPCAP: Quirky Nuggets (N01-N02)
SAP Community, Ajit Kumar Panda, Blog
[Part – 2] Enrich CAP based Services with Behaviors using Annotations
SAP Community, Lukas Schwabe, Blog
Understanding entity relationships in CDS
SAP Community, Avinash_Vaidya, Blog
SAP CAP Recent Enhancements the HANA Dev Should Know About
SAP Community, Thomas Jung, Blog
SAP CAP Adapter to expose OData as custom REST Service
SAP Community, Former Member, Blog
Creating structured types, enums and named aspects using the CDS Graphical Modeler
SAP Community, Xiao-fei_Song, BlogThe reasoning
Importing @sap/cds common.cds to your CAP project using the CDS Graphical Modeler
SAP Community, Xiao-fei_Song, Blog
First Java Cap Application
SAP Community, bruce_wang3, Blog
Developing Business Services with Cloud Application Programming(CAP) Model in SAP Business Studio
SAP Community, Ranjith, Blog
Computed field example in CAP
SAP Community, DJ Adams, BlogThe reasoningA recipeRunnable code
Core changed
SAP Cloud Platform Backend service: Tutorial [11]: CDS : magic: key: generation
SAP Community, CarlosRoggan, Blog
Develop a full stack Business application with SAP Cloud Application Programming Model
SAP Community, former_member584731, Blog
Learn how to define constraints declaratively in your CDS model
SAP Developer Center, SAP, TutorialThe reasoningA recipe
Explore the declarative power of status-transition flows
SAP Developer Center, SAP, TutorialThe reasoningA recipe
Analyze and optimize ABAP Cloud model apps built on core data services
SAP TechEd — session catalogue, TalkThe reasoning
CDS Associations & Joins
YouTube — SAP Developers playlists, SAP Developers, Talk
Analyze and optimize ABAP Cloud model apps built on core data services
SAP TechEd — session catalogue, TalkThe reasoning
A CAP Plugin for Flexible Number Range Management: cds-numberrange-plugin
SAP Community, abdulbasit, BlogThe reasoningRunnable code

Seen working7

ArtifactSignals
Samples7
abapconf2026-custom-entitiesabapconf 2026 talk materials on RAP custom entities
No license
capire/bookshopCAP's getting-started bookshop sample
none
SAP-samples/abap-platform-analytics-data-modelingAnalytical ABAP CDS models for the ABAP Flight Reference Scenario
none
SAP-samples/cap-cds-hands-onFive-part workshop on CDS, from a first service to constraints
none
SAP-samples/cloud-cap-hana-swapiCAP data model of many-to-many relationships on a Star Wars dataset
none
xflightsCAP reuse package serving Airlines, Airports and Flights data
none
xflights-javaCAP Java reuse package for Airlines, Airports and Flights data
none

Details

What changed — and what it makes stale3
@sap/cds 9.9.0, CAP, Node.js

Declarative constraints (@assert) moved from Gamma to General Availability, and a bug in error reporting was fixed alongside it: every violation used to return the generic error code ASSERT regardless of which constraint failed; now the code returned is the one named in the constraint itself.

Makes stale:

Error-handling code or tests written against declarative constraints before April 2026 that match on a literal 'ASSERT' error code — they now see the constraint's own code instead.

@sap/cds 9.6.0, CAP, Node.js

The compiler gained a declarative validation annotation, at Gamma status. Before it, a check like 'reject if this field is missing or out of range' meant a custom before-handler in application code; after it, @assert: (<CXL expression>) on an element states the condition in the model itself and the runtime validates it on write.

Makes stale:

Advice that any conditional validation beyond @mandatory or @assert.range needs a handwritten handler. Since December 2025 a CXL expression in @assert covers much of that ground, model-side.

@sap/cds 8.0.3, CAP, Node.js

cds.compile.to.hana generates the hdbtable and hdbview artifacts and replaces cds.compile.to.hdbtable. Dated from the first 8.0 release published on npm.

Makes stale:

Build scripts and posts that call cds.compile.to.hdbtable.

Coverage
statecore and community, CAP
assessed
state in ABAPcore and community, assessed
relationshipunassessed
also inABAP
For your agent
Ref
capability:data-modelling
JSON
/capabilities/data-modelling.json
MCP
Connecting an agent