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
cdscommand. -
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.yamlfile. -
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-mtaandpartners-s4. -
Finance guides:
ledger,ledger-postings,depreciationandcost-allocation. -
HR guides:
people,org-structure,payroll-periodandpeople-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 |
|
10.2.1 and 10.2.2 |
SAP Developer License Agreement, version 3.2 |
|
3.1.2 and 1.0.2 |
Apache-2.0 |
UI5 Tooling ( |
4.0.73 and 1.154.0 |
Apache-2.0 |
|
1.23.8 |
Apache-2.0 |
Google Chrome, only for the browser tests of |
any recent version |
Google terms |
|
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 |
|---|---|
|
Runs the tests of the project with the Node.js test runner and |
|
Starts the service with |
|
Starts the service with |
|
In |
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
General SAP guides, in the order that builds on earlier ones:
-
SAP Guide: Your First CAP Service builds the first model, service and CSV data in
expenses. -
SAP Guide: Add a Fiori Elements App to a CAP Service adds the annotations and the generated user interface to
expenses. -
SAP Guide: Model a Domain and Add Custom Logic in CAP uses
claims-model. -
SAP Guide: Your First SAPUI5 App uses
claims-ui5. -
SAP Guide: Query OData Services uses
odata-queries. -
SAP Guide: Secure a CAP Service with Roles uses
claims-secured. -
SAP Guide: Test a CAP Service and a UI5 App uses
claims-tested. -
SAP Guide: Package a CAP App as an MTA Archive uses
claims-mta; the build writes only to the foldergen/. -
SAP Guide: Consume an SAP API Specification in CAP uses
partners-s4.
Finance guides:
-
SAP Finance Guide: Post Balanced Journal Entries in a Teaching Ledger uses
ledger. -
SAP Finance Guide: Follow a Purchase and a Sale through the Ledger uses
ledger-postings. -
SAP Finance Guide: Compute a Depreciation Schedule uses
depreciation. -
SAP Finance Guide: Allocate Costs and Read a Trial Balance uses
cost-allocation.
HR guides:
-
SAP HR Guide: Model Employee Records with Validity Periods uses
people. -
SAP HR Guide: Build an Organizational Structure Model uses
org-structure. -
SAP HR Guide: Compute Pay for a Partial Period and Gross-to-Net uses
payroll-period. -
SAP HR Guide: Query Effective-Dated Employee Data uses
people-queries.
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-dkand@sap/cdsmeans 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 installonce, thennpm testruns its tests andnpm run watchstarts the service on port 4004. -
The packaging guide needs
mbtand the browser tests ofclaims-testedneed Chrome; thepartners-s4project 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.