Hands-on Lab

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

A hands-on lab is a set of small projects on your own computer where you can run what you read about. The SAP lab of this documentation holds one project for each SAP guide. They are built with the SAP Cloud Application Programming Model (CAP), a framework from SAP for writing business services, and they run on free tools that install without an SAP account, an SAP Universal ID, an S-user, a trial tenant, a Docker Hub login or an API key. This page explains what the lab contains, what you install and which licenses you accept by installing, which commands run and test a project, and which guide uses which project. The projects are teaching models: they are not SAP S/4HANA, SAP SuccessFactors or SAP HCM and they do not reproduce their screens. The lab was checked on 2026-11-13 with Node.js 24.21 and CAP Node.js 10.2 (@sap/cds 10.2.2, @sap/cds-dk 10.2.1).

Before you read

  • What Is SAP: the product families, so you know what the teaching models stand in for.

  • CAP Getting Started: what CAP is and what its command line does.

You need a terminal and a text editor. No SAP knowledge is needed to install the lab.

Key terms

  • SAP Cloud Application Programming Model (CAP): SAP’s framework for building business services and data models, run here on Node.js.

  • CDS (Core Data Services): the language in which CAP describes data models and services.

  • cds-dk: the CAP development kit, which brings the cds command.

  • OpenUI5: the open-source edition of the UI5 framework for browser applications, used for the lab’s small user interface.

  • UI5 Tooling (UI5 CLI): the command line tool that serves, builds and checks UI5 projects.

  • Multitarget application (MTA): a bundle of several deployable parts described by one mta.yaml file.

  • Mocking: standing in for a real system with a simple local copy, as the lab does for an SAP API and for sign-in.

What the lab contains

The lab is the folder modules/ROOT/examples/sap-lab/ of the documentation sources. Each subfolder is a separate project with its own package.json, and every dependency version is pinned there. The projects fall into three groups:

  • General SAP guides: expenses, claims-model, claims-ui5, odata-queries, claims-secured, claims-tested, claims-mta and partners-s4.

  • Finance guides: ledger, ledger-postings, depreciation and cost-allocation.

  • HR guides: people, org-structure, payroll-period and people-queries.

Nothing in the lab connects to an SAP system. CAP runs the services on your computer against an in-memory SQLite database, and its built-in mocked users stand in for real sign-in. The only network traffic is the download from the public npm registry when you install, and the one file the partners-s4 project asks you to download (see below).

What you install and the licenses you accept

Tool Version used License you accept by installing

Node.js

22.12 or newer

OpenJS Foundation terms

@sap/cds-dk and @sap/cds

10.2.1 and 10.2.2

SAP Developer License Agreement, version 3.2

@cap-js/sqlite and @cap-js/cds-test

3.1.2 and 1.0.2

Apache-2.0

UI5 Tooling (@ui5/cli) and OpenUI5

4.0.73 and 1.154.0

Apache-2.0

@ui5/linter

1.23.8

Apache-2.0

Google Chrome, only for the browser tests of claims-tested

any recent version

Google terms

mbt, the Cloud MTA Build Tool

1.2.52

Apache-2.0

The two CAP packages are the only ones under a license other than an open-source one. The packages state that installing or using them means agreeing to the SAP Developer License Agreement, version 3.2, so by running npm install in a lab project you accept it. Read the agreement in the package before you install if you need to; the guides repeat the notice in their "Before you start" lists. Chrome is not installed by npm; if it is not in a default place, set the environment variable CHROME_BIN to its path.

Copy the project folder you need out of the documentation sources to a place of your own and run the commands there, so that the generated node_modules folders stay out of the documentation sources. To use the cds command anywhere, and the mbt build tool for the packaging guide, install them once:

npm install --global @sap/cds-dk mbt@1.2.52

Commands to run

Inside a project folder, run npm install once, then use the scripts of its package.json:

Command What it does

npm test

Runs the tests of the project with the Node.js test runner and cds.test, which starts the service in the test process. The exit code is 0 when all pass.

npm run watch

Starts the service with cds watch, restarting it when a file changes, and serves it at http://localhost:4004.

npm start

Starts the service with cds-serve.

npm run ci

In claims-tested: runs the service tests, the UI5 linter and the browser tests of the UI5 app in a headless Chrome.

The UI5 app of claims-ui5 has its own folder ui/: run npm install and npm start there while the service of the project folder runs, and open http://localhost:8080/index.html?sap-ui-language=en.

The project partners-s4 expects one file that is not in the repository: the EDMX description of the SAP API_BUSINESS_PARTNER. In a copy, run curl -sSL -o API_BUSINESS_PARTNER.edmx https://raw.githubusercontent.com/capire/s4/main/srv/external/API_BUSINESS_PARTNER.edmx (Apache-2.0, about 695 KB), then cds import API_BUSINESS_PARTNER.edmx --as cds, then npm install and npm test.

This is the real output of the first project in a copy of the lab, checked on 2026-11-13. The package counts and test counts change when the lab changes, so only the shape of the output matters.

$ cd expenses
$ npm install
added 77 packages, and audited 192 packages in 882ms
found 0 vulnerabilities
$ npm test
✔ lists claims (146.658334ms)
ℹ tests 1
ℹ pass 1
ℹ fail 0

The tests of claims-secured, ledger and org-structure were run the same way on that day, and every test passed. The projects claims-ui5, claims-tested and claims-mta were not run for this page; their guides show their output.

The guides that use the lab

Why the lab uses no SAP trial or system

An SAP trial or an SAP system needs an account and a sign-in, and this documentation keeps every step account-free so that you can follow it with nothing but a computer. CAP is built so that the same service code runs locally against SQLite and later on SAP BTP, which makes it a fair place to practice the shape of SAP development. The price is that the models are small: they teach the ideas of finance and HR processing, not the screens, tables or rules of the real products. Check anything you build against a real system and its documentation before you rely on it there.

Summary

  • The SAP lab is a set of CAP teaching projects that run on your computer with no SAP account, trial or API key.

  • Installing @sap/cds-dk and @sap/cds means accepting the SAP Developer License Agreement, version 3.2; the other tools are Apache-2.0 or under Node.js and Google terms.

  • In a project folder, npm install once, then npm test runs its tests and npm run watch starts the service on port 4004.

  • The packaging guide needs mbt and the browser tests of claims-tested need Chrome; the partners-s4 project needs one downloaded EDMX file.

  • Seventeen guides use sixteen projects, grouped as general, Finance and HR.

  • The projects are teaching models, not SAP S/4HANA, SuccessFactors or HCM.