sap-activate-object
Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for reports/programs/function- group…
Executes ABAP Unit tests on a deployed object (program or global class) via SAP GUI Scripting and reports per-method pass / fail with a verdict gate. Opens the object in SE38 / SE24, triggers the ABAP Unit run (via the SE38/SE24 menu), and parses the result display. Closes the
$ npx -y skills add sapdev-ai/sap-dev --skill sap-run-abap-unit --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sap-run-abap-unitContext preview
The summary Claude sees to decide when to auto-load this skill.
Executes ABAP Unit tests on a deployed object (program or global class) via SAP GUI Scripting and reports per-method pass / fail with a verdict gate. Opens the object in SE38 / SE24, triggers the ABAP Unit run (via the SE38/SE24 menu), and parses the result display. Closes the
name: sap-run-abap-unit description: | Executes ABAP Unit tests on a deployed object (program or global class) via SAP GUI Scripting and reports per-method pass / fail with a verdict gate. Opens the object in SE38 / SE24, triggers the ABAP Unit run (via the SE38/SE24 menu), and parses the result display. Closes the generate -> deploy -> activate -> TEST loop for /sap-gen-abap output (Z<PROGRAM_ID>_TEST) and works standalone on any brownfield object. GUI backend, verified on S/4HANA 1909. Results-only by default; with --with-coverage it ALSO measures code coverage (Unit Tests With Coverage), running the suite twice (counts + coverage) since the coverage display has no status-bar summary. The RFC backend (Z_AUNIT_RUN, Phase 2) does both in one headless call. Result/coverage component IDs are release-specific; if the skill emits NEEDS_RECORDING, record them once with /sap-gui-probe --record (see "Result parsing" below). Prerequisites: Active SAP GUI session (use /sap-login first); developer authorization to run ABAP Unit (S_DEVELOP on the object). argument-hint: "<OBJECT_NAME> [--type=PROGRAM|CLASS] [--with-coverage] [--min-coverage=<n>] [--mode=GUI] [--save-to=<PATH>]"
You execute ABAP Unit tests on a deployed object and apply a pass/fail gate. The GUI backend opens the object, runs ABAP Unit, and parses the result display. With `--with-coverage` it additionally measures code coverage (a second "Unit Tests With Coverage" run). The RFC backend (Phase 2) does both headless.
Task: $ARGUMENTS
---
| File | Purpose | |---|---| | `<SAP_DEV_CORE_SHARED_DIR>/rules/safety_policy.md` | **Rule 0 (highest priority)** — environment guard; enforced by Step 0.6 via `sap_safety_gate.ps1` | | `<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md` | Mandatory operating rules | | `<SAP_DEV_CORE_SHARED_DIR>/rules/language_independence_rules.md` | GUI-scripting language independence -- identify by component ID, status via `MessageType`, VKey over menu-text, no `.Text`/`.Tooltip` branching | | `<SKILL_DIR>/references/sap_se38_run_aunit.vbs` | Run + parse for a PROGRAM target (SE38) | | `<SKILL_DIR>/references/sap_se24_run_aunit.vbs` | Run + parse for a global CLASS target (SE24) | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_artifact_lib.ps1` | `New-SapScopeKey` / `Register-SapArtifact` — register the result JSON so `/sap-evidence-pack` collects it under the object's scope (Kind `unit_results`). Best-effort; never changes the verdict. |
---
The trigger and result parse were verified end-to-end on S4D (2026-06-03):
(`mbar/menu[0]/menu[9]/menu[2]`); SE24 `Class Source > Run > Unit Tests` (`mbar/menu[0]/menu[7]/menu[0]`). Ctrl+Shift+F10 is SE80-only and raises *"The virtual key is not enabled"* on the SE38/SE24 editor screens.
Failures = alert-ALV rows whose `ICON_LEVEL` is **not** tolerable: `@8R` (Tolerable — e.g. a class's "no test relation" warning) is a warning, NOT a failure; `@8O` (Critical) / Fatal are. (A self-testing class with a tolerable "no test relation" warning opens this display even on all-pass ⇒ tolerable-only ⇒ `failed=0`; a class with a normal test relation, and a report, stay on the editor when all-pass. All verified live.)
the VBS reads the last integer (locale-independent digits) as the total.
opens the AUCV display (`Program=SAPLSAUCV_DISPLAY_MULTI_TAB`); the "Coverage Metrics" tab (`tabpFSCOV`) holds a tree whose root-node `PERCENTAGE` is the overall coverage. That display has no status-bar summary — hence the two-phase run. The coverage subscreen number is launch-variant, so the VBS **searches** `tabpFSCOV` for the `PERCENTAGE`-column tree instead of hardcoding the path. Verified live: SE38 `33.33%` (report) and SE24 `50.00%` (class with a `CCAU` test relation). A self-testing class with no production code under test ("no test relation") has no coverage tree ⇒ `coverage=NA`. When a requested coverage read comes back NA, the VBS emits a `COVERAGE_REASON:` line first — `screen unreachable (...)` when the coverage menu never reached the AUCV display, `value cell not found (...)` when AUCV opened but no `PERCENTAGE` tree exists — so the NA is diagnosable.
These are program-name / message-type / row-count signals — all language-neutral. On a **different release**, if the alert-grid path shifts, the VBS prints `UNIT_TEST_RUN: NEEDS_RECORDING program=<P> screen=<S>` instead of a false green; record the new path via `/sap-gui-probe --record` and prepend it to the `gcands` array in both `sap_se38_run_aunit.vbs` and `sap_se24_run_aunit.vbs` (same one-time-per- release model as `/sap-atc`).
---
Resolve `work_dir` via the env-aware helper (NOT a direct `settings.json` read):
powershell -NoProfile -ExecutionPolicy Bypass -Command ". '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_settings_lib.ps1'; . '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'; Write-Output ('WORK_DIR=' + (Get-SapWorkDir)); Write-Output ('RUN_TEMP=' + (Get-SapRunTemp))"`{WORK_TEMP} = work_dir\temp`. Settings reads follow `shared/rules/settings_lookup.md`.
cmd /c if not exist "{WORK_TEMP}" mkdir "{WORK_TEMP}"Set `{RUN_TEMP}` = the `RUN_TEMP=` value printed above — a fresh per-run scratch directory `{work_dir}\temp\run_<id>`, already created by `Get-SapRunTemp`. Resolve it **once here** and reuse the same value for the rest of this
SAP development automation skills for AI coding assistants. Windows-only — the skills drive SAP GUI for Windows via GUI Scripting (plus optional RFC via SAP NCo); there is no macOS/Linux path.
Repo: sapdev-ai/sap-dev
Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for reports/programs/function- group…
Natural-language SAP API discovery over RFC (no GUI): turn a goal like "create a sales order" or "post a goods movement" into a ranked, trap-annotated,…
Runs the SAP ABAP Test Cockpit (ATC) end-to-end as a quality gate: builds an SCI Object Set scoped to the target object(s), creates an ATC Run Series bound to…
Executes BDC (Batch Data Communication) sessions in SAP via RFC. Reads SHDB recording files from the bdc/ folder, connects via SAP NCo 3.1, calls…
Changes the package (TADIR-DEVCLASS) assignment of an SAP repository object via the "Object Directory Entry" dialog (Goto > Object Directory Entry). Routes by…
Validates ABAP source (report / program / FM / class / include) before deployment — one skill, dimension-dispatched: naming (variable conventions), type (DDIC…