Skip to content
Development
Command

/cap-cds-reference

Topic: entities, services, annotations, queries, or types

From plugin
sap-skills
48569 skills31 agents69 commands8 MCP
$ npx -y skills add secondsky/sap-skills --agent claude-code

Command definition

cap-cds-reference.md
name: cap-cds-reference
description: Quick CDS syntax reference for entities, services, annotations, and queries
allowed-tools:
  - Read
  - Grep
  - Glob
argument-hint: "[topic]"
arguments:
  - name: topic
    description: "Topic: entities, services, annotations, queries, or types"
    required: false

Shell Snippet Notes

  • Shell snippets assume Bash on Linux/macOS, WSL2, or Git Bash.
  • Install the command-specific tooling shown near each snippet before running it.
  • Confirm before running commands that delete files, change ownership, deploy, or modify remote systems.

Output Contract

Return the requested CDS reference, version-sensitive caveats, minimal examples, and related CAP commands or references. Default to read-only guidance and mark runtime or activation checks as pending unless project evidence is available.

CAP CDS Quick Reference

Comprehensive CDS (Core Data Services) syntax reference for SAP Cloud Application Programming Model.

Entities

Basic Entity

entity Books {
  key ID : UUID;
  title  : String(100);
  price  : Decimal(10,2);
  stock  : Integer;
}

Entity with Aspects

using { cuid, managed } from '@sap/cds/common';

entity Books : cuid, managed {
  title  : String(100);
  price  : Decimal(10,2);
}
// cuid adds: ID : UUID
// managed adds: createdAt, createdBy, modifiedAt, modifiedBy

Associations

entity Books {
  key ID     : UUID;
  title      : String(100);
  author     : Association to Authors;  // to-one
  reviews    : Composition of many Reviews on reviews.book = $self;  // to-many
}

Services

Basic Service

service CatalogService {
  entity Books as projection on my.Books;
  entity Authors as projection on my.Authors;
}

Service with Actions

service OrdersService {
  entity Orders as projection on my.Orders actions {
    action cancel() returns String;
  };
}

Annotations

Basic Annotations

entity Books {
  title  : String(100) @title: 'Book Title';
  price  : Decimal(10,2) @title: 'Price';
  stock  : Integer @assert.range: [0, 9999];
}

UI Annotations (Fiori)

annotate CatalogService.Books with @(
  UI.LineItem: [
    { Value: title, Label: 'Title' },
    { Value: author.name, Label: 'Author' }
  ]
);

CQL Queries

SELECT

const books = await SELECT.from(Books);
const book = await SELECT.one.from(Books).where({ ID: bookID });

INSERT

await INSERT.into(Books).entries({ title: 'CAP Guide', price: 29.99 });

UPDATE

await UPDATE(Books).set({ stock: stock + 10 }).where({ ID: bookID });

DELETE

await DELETE.from(Books).where({ ID: bookID });

Complete Reference

For comprehensive documentation, see:

  • [CDL Syntax Reference](../skills/sap-cap-capire/references/cdl-syntax.md)
  • [Annotations Reference](../skills/sap-cap-capire/references/annotations-reference.md)
  • [CQL Queries Reference](../skills/sap-cap-capire/references/cql-queries.md)
Read more
@secondsky
Ships withsap-skills

40 SAP development plugins with evidence-tracked verification SAP development plugins for AI coding assistants, with public-source or package-registry verification tracked where available.

48540 skills31 agents8 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
485
Star history of secondsky/sap-skills on GitHub, a chart by star-history.com

Other commands on sap-skills.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command