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 small project folder on your own computer where you can run the code you read about. The ABAP lab of this documentation lets you write ABAP, run it and test it without an SAP system, an SAP account, a trial or a sign-in of any kind. A free tool called a transpiler translates your ABAP files into JavaScript, and Node.js, a program that runs JavaScript outside a browser, executes the result. This page explains what the lab contains, what you install and under which licences, which commands you run, and what the lab cannot do. The lab is a community project and is not SAP software, so it is a place to learn the language, not a replacement for a real system. It was checked on 2026-11-13 with Node.js 24.21, the abaplint transpiler 2.14.30 and the abaplint checker 2.120.103, and it implements only a subset of Standard ABAP; it has nothing of ABAP Cloud’s released APIs.
Before you read
-
Getting Started with ABAP: what an ABAP program is and where it normally runs.
-
ABAP Guide: Set Up a Local ABAP Playground: the step-by-step guide that builds this lab, if you would rather build it than download it.
You need a terminal and a text editor. No ABAP knowledge is needed to install the lab.
Key terms
-
open-abap: a community open-source project that runs a subset of ABAP on Node.js; it is not SAP software.
-
Transpiler: a program that translates source code from one language into another, here ABAP into JavaScript.
-
abaplint: a free checker for ABAP source code that reports style and correctness findings by rule name.
-
abapGit: the file layout, one file per ABAP object, that the lab uses to store its sources.
-
ABAP Unit: ABAP’s built-in framework for writing automatic tests; the lab runs it locally.
-
ABAP SQL: the part of ABAP that reads and changes database tables; the lab runs it on an in-memory SQLite database.
What the lab contains
The lab is the folder modules/ROOT/examples/abap-lab/ of the documentation sources. Its parts work together like this:
-
The sources are in
src/, in the abapGit layout: a filename.type.abapholds the code of an object and a filename.type.xmlholds its description (for examplezhello.prog.abapis the reportZHELLO, andzcl_greeter.clas.abapis the classZCL_GREETER). -
The table of the running example is
src/zexp_claim.tabl.xml. It is a reduced version of the tableZEXP_CLAIMthat the page DDIC Tables and Structures defines: the lab table keeps only the claim number, the status and the amount. -
abap_transpile.jsontells the transpiler where the sources are and which library to add. The library is open-abap-core, the open-source implementation of ABAP’s basic classes and functions, which the transpiler downloads from GitHub on the first run. -
setup.mjscreates the in-memory SQLite database from the table definitions undersrc/before the tests start, so that ABAP SQL has a database to read. -
abaplint.jsonholds the rules for the abaplint checker, andlint-demo/holds one deliberately flawed class that the checker reports on purpose.
Nothing in the lab connects to an SAP system, and nothing asks for an account. The only network traffic is the download from the public npm registry and from GitHub when you install and when the transpiler first runs.
What you install and the licences you accept
The packages are pinned to exact versions in package.json. Installing them means you accept their licences, which are all permissive open-source licences.
| Tool | Version used | Licence |
|---|---|---|
Node.js |
22.12 or newer |
OpenJS Foundation terms |
|
2.14.30 |
MIT |
|
2.14.12 |
MIT |
|
2.120.103 |
MIT |
open-abap-core, cloned by the transpiler from GitHub |
commit |
MIT |
Node.js comes from the Node.js download page. The four abaplint packages come from the public npm registry. Copy the folder abap-lab from the documentation sources to a place of your own and run the installation there, so that the generated node_modules and output folders stay out of the documentation sources:
cd abap-lab
npm install
Commands to run
All commands are npm scripts defined in package.json; run them inside the abap-lab folder.
| Command | What it does |
|---|---|
|
Transpiles |
|
Runs the report |
|
Runs |
|
Runs |
|
Runs |
|
Runs |
|
Runs |
|
Runs abaplint with the rules of |
|
Runs abaplint on the flawed class in |
This is the real output of the commands in a copy of the lab, checked on 2026-11-13. The transpiler’s own messages, such as the number of files written, change when the lab gains files, so they are cut here.
$ npm test
ZCL_GREETER: running ltcl_greeter->greets_by_name
ZUT_CLAIM_LIMIT: running ltcl_limit->small_amount_is_accepted
ZUT_CLAIM_LIMIT: running ltcl_limit->large_amount_is_rejected
ZUT_CLAIM_LIMIT: running ltcl_limit->amount_at_limit_is_accepted
ZUT_CLAIM_LIMIT: running ltcl_limit->status_text_follows_limit
$ npm run run:hello
Hello from the local ABAP playground
$ npm run lint
abaplint: 0 issue(s) found, 35 file(s) analyzed
$ npm run lint:demo
lint-demo/src/zlint_claims.clas.abap[3, 11] - Avoid hungarian notation (no_prefixes) [E]
lint-demo/src/zlint_claims.clas.abap[6, 17] - Prefer RETURNING to EXPORTING (prefer_returning_to_exporting) [E]
lint-demo/src/zlint_claims.clas.abap[11, 10] - Variable "lv_unused" not used (unused_variables) [E]
lint-demo/src/zlint_claims.clas.abap[12, 10] - Prefer Inline Declarations, LV_AMOUNT (prefer_inline) [E]
lint-demo/src/zlint_claims.clas.abap[15, 5] - Keyword should be upper case: "loop" (keyword_case) [E]
abaplint: 5 issue(s) found, 2 file(s) analyzed
The 35 files in the npm run lint line are the number the lab had on the day of the check; the count grows when guides add files.
The guides that use the lab
Every ABAP guide runs in this lab. Do them in this order, because each one builds on the files of the one before:
-
ABAP Guide: Set Up a Local ABAP Playground creates the project and runs a first report and test.
-
ABAP Guide: Your First ABAP Program writes a report and meets the first error message.
-
ABAP Guide: Data Types, Strings and String Templates declares data, builds strings and splits text.
-
ABAP Guide: Work with Internal Tables fills, reads, sorts and filters tables in memory.
-
ABAP Guide: Classes, Interfaces and Exceptions writes classes, an interface and an exception class.
-
ABAP Guide: Write ABAP Unit Tests writes a passing and a failing test and reads the exit codes.
-
ABAP Guide: Check Code against Clean ABAP Rules runs abaplint and fixes a class until it is clean.
-
ABAP Guide: ABAP SQL on a Local Database reads and changes rows of the in-memory table.
What open-abap supports and what it does not
The checks below were run in the lab on 2026-11-13, one statement at a time, each in a test that asserts the result. A statement in the second list is not taught in the guides; its reference page describes it and labels the examples "requires an SAP system; not run here".
Runs correctly in the lab:
-
local and global classes, interfaces, exception classes,
RAISE EXCEPTIONandTRYwithCATCH; -
inline declarations,
VALUE,CONV,CORRESPONDING,REDUCEandFILTERon a sorted table; -
string templates, the string functions
to_upper,condense,replace,strlen,substringandfindwith a regular expression, andSPLIT ... INTO TABLE; -
table expressions,
line_exists,SORT,READ TABLE,AT NEWandlines; -
ABAP Unit with
cl_abap_unit_assert, where a failing assertion ends the run with exit code 1; -
reports with
WRITE; -
ABAP SQL
SELECT(withWHERE,IN,BETWEEN,LIKE,ORDER BY,DISTINCT,UP TO n ROWS,COUNT( * ),INNER JOIN,FOR ALL ENTRIES),INSERT,UPDATE,DELETEandMODIFYon tables defined as abapGit.tabl.xmlfiles.
Not supported or wrong in the lab:
-
LOOP AT ... GROUP BY, which the transpiler rejects, andCOLLECT, which gives a wrong result; -
the SQL functions
SUM,AVG,MINandMAX, the SQL clauseGROUP BYand the SQLCASEexpression; -
sy-dbcntafter anUPDATE, which returns 0 instead of the number of changed rows; -
the formatting option
WIDTHwithALIGN = RIGHTin a string template, which aligns left; -
output with
out->writeofIF_OO_ADT_CLASSRUN, because open-abap-core has no output class for it; the guides print withWRITEin a report; -
everything that needs an SAP system: the ABAP Dictionary tools, CDS views, RAP, SAP GUI, ABAP Development Tools, authorization checks and released SAP APIs.
Why the lab uses no SAP system
The ways to get an SAP system to learn on usually involve an account, a trial tenant or a container image, and this documentation keeps every step account-free so that you can follow it with nothing but a computer. The price is the list of limits above. A program that passes here proves that the statement works in open-abap, not that it works on an SAP system, so check a program on a real system before you rely on it there.
Summary
-
The ABAP lab runs a subset of ABAP on Node.js with the abaplint transpiler and the open-abap runtime; it is community software, not SAP software.
-
You install it with
npm installfrom the public npm registry; the packages are MIT-licensed and nothing asks for an account. -
npm testruns the ABAP Unit tests,npm run run:helloand its siblings run the reports of the guides, andnpm run lintruns abaplint. -
The database is an in-memory SQLite database created from
.tabl.xmltable definitions. -
Grouping, SQL aggregates,
out->write, CDS, RAP and everything that needs an SAP system are outside the lab. -
Eight guides use the lab, in a fixed order starting with the set-up guide.
Try it
To do this by hand, follow the guide Set Up a Local ABAP Playground: it installs the free local playground and runs a first sample without an SAP system or an account.