Skip to content
Development
Command

/cap-cds-reference

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

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

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/cap-cds-reference

Context preview

What this command does when you run it.

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

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

Get the whole plugin