ERPClimb logoERPClimb
CAP
BTP & Integrationintermediate 4 min read

BTP CAP Part 2: Building and Exposing Services with CDS

Preview · a free account unlocks the full lesson

Key takeaway

Design CAP services: projections on domain entities, service-level exposure choices (read-only, restricted fields), annotations for OData and UI, mock data, hybrid testing against real BTP services with cds bind, and database deployment with cds deploy.

In this lessonShow sections

Visual overview

SERVICESDesigning consumer-specific CAP servicesOne domain model, several services1Domain modelEntities in db/schema.cds2Consumer needsCatalog users vs adminsDesign3ProjectionsFields, excluding, @readonlysrv/*.cds4Mock & real dataCSV locally; cds bind for HANAHybridOData endpointsTailored per consumerOData V4Tip: separate services per consumer beat one service full of conditions.

Explanation

Part 1 introduced CAP; this part covers building and exposing services with CDS. Services expose projections of the underlying domain entities, tailored to a specific consumer — selecting particular fields, marking some read-only, applying filters. Annotations such as @readonly, @insertonly and various UI annotations shape how OData and Fiori actually behave against a given service.

CSV files placed in db/data provide mock data for local development, and running cds deploy writes that data into the target database. cds bind connects a local run to real BTP services, such as HANA Cloud or XSUAA, enabling hybrid testing against the real thing rather than only mocks.

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.