/sap-dev-core:sap-st22 [--anchor PATH] [--user U] [--date today|YYYYMMDD] [--window MIN] [--session PATH] [--out PATH] [--top-n N] [--deep] [--dump-key KEY] [--max-deep N] [--no-fingerprint]from sap-dev-core
Reads ABAP runtime-error (short dump) evidence from SAP ST22 via GUI scripting. Collects dump list and optionally deep-scrapes failing source lines for root-cause analysis.
Ships in sap-dev-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You drive ST22 read-only, display the dump list for the incident window, and emit one evidence event per dump. GUI mode — no ADT.
Task: $ARGUMENTS
| File | Token | Purpose |
|---|---|---|
<SAP_DEV_CORE_SHARED_DIR>/rules/language_independence_rules.md | (rule) | Address controls by ID; status via MessageType; VKey navigation; no text branching. |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_attach_lib.vbs | %%ATTACH_LIB_VBS%% | Parallel-safe session attach (AttachSapSession). |
<SKILL_DIR>/references/sap_st22_read.vbs | (reader) | ST22 navigation + dump-list scrape → evidence JSON. |
<SKILL_DIR>/references/sap_st22_fingerprint.ps1 | (local) | Dump fingerprint + recurrence ledger ({custom_url}\ops_kb\dump_fingerprints.tsv); NEW/KNOWN_RECURRING/GONE delta. Pure-local, best-effort. |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_log_helper.ps1 | (lib) | start/end logging. |
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 ('CUSTOM_URL=' + (Get-SapSettingValue 'custom_url' ((Get-SapWorkDir) + '\custom')))"
Set {WORK_TEMP} = {work_dir}\temp; {RUN_DIR} = a fresh {WORK_TEMP}\diagnose\<run> (or the orchestrator's run dir when --anchor points into it). Parse {custom_url} from the CUSTOM_URL= line — the fingerprint ledger (Step 2.5) lives at {custom_url}\ops_kb\dump_fingerprints.tsv.
Set {RUN_TEMP} = the per-run scratch dir (Get-SapRunTemp mints + creates {work_dir}\temp\run_<id>):
powershell -NoProfile -ExecutionPolicy Bypass -Command ". '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'; Write-Output ('RUN_TEMP=' + (Get-SapRunTemp))"
Per the CLAUDE.md "Two-bucket temp model" write this skill's _run.json log state under {RUN_TEMP} (the reader scratch already lives in the per-run {RUN_DIR}); keep {WORK_TEMP} (base) only for Get-SapCurrentSessionPath -WorkTemp.
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_st22_run.json" -Skill sap-st22 -ParamsJson "{}"
--anchor <path> (orchestrator) or build {RUN_DIR}\anchor.json from flags.
Parse the deep flags from $ARGUMENTS: --deep → $deep=$true; --dump-key <KEY> → $dumpKey; --max-deep <N> → $maxDeep (default 5). Derive the ST22
params file from the anchor:
$a = Get-Content '{RUN_DIR}\anchor.json' -Raw -Encoding UTF8 | ConvertFrom-Json
$from = "$($a.window.from_ts)"; $to = "$($a.window.to_ts)"
$lines = @(
"FROMDATE=" + $from.Substring(0,8),
"TODATE=" + $to.Substring(0,8),
"USER=" + "$($a.user)",
"TOPN=200"
)
# Deep mode (only when the caller passed --deep): open each in-scope dump and
# scrape the failing line + snippet. --dump-key scopes to one dump (the
# synthetic key = yyyymmdd + hhmmss + program); --max-deep bounds the crawl.
if ($deep) { $lines += "DEEP=1" }
if ($dumpKey) { $lines += "DUMPKEY=$dumpKey" }
if ($maxDeep) { $lines += "MAXDEEP=$maxDeep" }
$lines | Set-Content '{RUN_DIR}\st22_params.txt' -Encoding Default
Empty
USERmeans all users. The reader always assigns the user field — clearing SAP's pre-filled current user on newer RSSHOWRABAX selection screens (required for the ALV to render there) — so an anchor without--userreturns dumps for all users in the window, uniformly across releases.
Deep mode is read-only too. Opening a dump and pressing Back changes nothing in SAP. But it is slower (one GUI round-trip per dump), so it is opt-in and bounded by
--max-deep./sap-diagnoseonly requests--deepwhen a hypothesis needs the failing line (i.e. the custom-code-defect path that feeds/sap-fix-incident).
Substitute the attach tokens + IO paths, baking this AI session's pinned
session path into %%SESSION_PATH%% so the attach helper targets the pinned
connection (per the parallel-safe attach contract).
$shared = '<SAP_DEV_CORE_SHARED_DIR>\scripts'
. "$shared\sap_connection_lib.ps1"
# BAKE the path (attach Strategy 1) rather than exporting $env:SAPDEV_SESSION_PATH:
# this generator is a SEPARATE process from the one that runs cscript, so the env
# var would already be gone and the helper would silently fall through to its
# sole-connection default -- reporting another system's dumps (2026-08-06).
$sessionPath = Get-SapCurrentSessionPath -WorkTemp '{WORK_TEMP}' # or the --session value
$vbs = [IO.File]::ReadAllText('<SKILL_DIR>\references\sap_st22_read.vbs', [Text.Encoding]::UTF8)
$vbs = $vbs.Replace('%%ATTACH_LIB_VBS%%', "$shared\sap_attach_lib.vbs")
$vbs = $vbs.Replace('%%SESSION_PATH%%', $sessionPath)
$vbs = $vbs.Replace('%%PARAMS_FILE%%', '{RUN_DIR}\st22_params.txt')
$vbs = $vbs.Replace('%%OUTPUT_FILE%%', '{RUN_DIR}\evidence_st22.json')
[IO.File]::WriteAllText('{RUN_DIR}\st22_run.vbs', $vbs, [System.Text.UnicodeEncoding]::new($false, $true))
Declare the GUI target in the SAME block as cscript, so the dumps in the evidence
file provably came from the system the rest of /sap-diagnose read over RFC:
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'
Set-SapGuiTargetExpectation -WorkTemp '{WORK_TEMP}' | Out-Null
& 'C:\Windows\SysWOW64\cscript.exe' //NoLogo "{RUN_DIR}\st22_run.vbs"
(32-bit cscript is mandatory — SAP GUI Scripting COM is 32-bit. Never cmd /c.)
Unless --no-fingerprint was passed or the reader returned status=skipped
(no evidence to fingerprint), fold this run's dumps into the recurrence ledger.
Pure-local, best-effort — it NEVER changes the reader verdict:
powershell -NoProfile -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_st22_fingerprint.ps1" -EvidenceFile "{RUN_DIR}\evidence_st22.json" -LedgerPath "{custom_url}\ops_kb\dump_fingerprints.tsv"
Parse the machine lines — FINGERPRINT: <fp> precision=<deep|list> status=<NEW|KNOWN_RECURRING> count=<n> …, GONE: <fp> days=<n> …, and the final STATUS: OK new=<n> recurring=<m> gone=<g> … — and surface them in Step 3. A STATUS: SKIP … line means the step no-op'd (evidence missing / ledger IO error): report nothing and continue. --deep runs produce the finer precision=deep grain (exception|program|include|line); list-level runs produce precision=list.
Parse EVIDENCE: source=ST22 status=ok events=<n> deep=<n> ... +
evidence_st22.json. If status=skipped, report the reason (likely "grid not
found — run /sap-gui-probe --record on ST22"). In --deep mode, each event may carry a
dump_detail object — surface its detail_status:
ok — failing include/line + a source_extract snippet were captured
(this is what a downstream fix consumes).partial — the dump was opened but its body was not scrapeable (typically an
HTML-rendered dump). The exception / program are still known from the list
level; recommend a /sap-gui-probe --record pass on the ST22 dump-detail screen for
this release. Never report partial as "no defect found."skipped — could not re-open the dump from the list.Recurrence (from Step 2.5). Report the NEW vs KNOWN_RECURRING split plus any
GONE (not-seen-in-N-days) fingerprints — e.g. "3 dumps: 1 NEW (MESSAGE_TYPE_X
in ZFOO), 2 KNOWN_RECURRING (first seen 2026-06-30, total 11)". A KNOWN_RECURRING
with a high total is a chronic dump worth escalating; a NEW dump inside a
release window is a regression signal. The ledger persists at
{custom_url}\ops_kb\dump_fingerprints.tsv for /sap-diagnose --kb match,
/sap-health-check trend, and /sap-evidence-pack.
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_st22_run.json" -Status SUCCESS -ExitCode 0
status=skipped with a hint to run /sap-gui-probe --record on ST22 and
update the candidates in sap_st22_read.vbs.dump_key (date+time+program) so SM13 can link to it. --deep adds the
failing line + source snippet on top (see below).wnd[0]) for GuiTextedit
controls and anchors the error line on the locale-independent >>>> marker.
On releases that render the dump as an HTML viewer — or as the newer
RSSHOWRABAX screen-120 "Runtime Error Long Text" GuiTree navigator, whose
section content is not scriptable (observed live on S4H/S4G 2026-07-24) —
there is no readable text control, so deep returns detail_status=partial
(exception/program still captured) — run /sap-gui-probe --record on the ST22
dump-open and add the detail container ID to sap_st22_read.vbs
(ReadDetailText candidates) to lift it to ok. The GuiTextedit + >>>>
scrape path degrades safely but has not yet been recorded against a release
that renders the dump as scriptable text.call_stack / chosen_variables
arrays in dump_detail) is the next deep increment; v1 deep leaves them empty.sapgui/user_scripting = TRUE.first_seen /
last_seen use the workstation date (local bookkeeping, not an SAP timestamp);
a missing evidence file or ledger IO error surfaces as STATUS: SKIP … and
never fails the reader. --no-fingerprint skips Step 2.5 entirely.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-dev-core61 skills in this plugin
/sap-activate-objectActivates an inactive SAP repository object via SAP GUI Scripting. Routes to
the correct transaction by object type: SE38 for reports/programs/function-
group main programs, SE37 for function modules, SE24 for classes/interfaces
/methods, SE11 for DDIC objects (table, view, dataelement, structure,
tabletype, typegroup, domain, searchhelp, lockobject). Handles the
"inactive objects worklist" popup that SAP shows when there are multiple
inactive objects of the same locality (transportable vs. local — SAP filters
the popup by package locality of the triggering object). Verifies activation
via PROGDIR (programs/FMs include) and DWINACTIV.
Prerequisites: Active SAP GUI session (use /sap-login first).
/sap-api-advisorNatural-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,
paste-ready shortlist of BAPIs / function modules / classes — with released
state (S/4), interface + documentation for the top candidates, the team's known
traps inlined, and a ready-to-paste CALL FUNCTION snippet. Reads the BAPI
catalog (BAPI_MONITOR_GETLIST), TFDIR/TFTIT name+text, SEOCLASS, ARS_W_API_STATE
(S/4 released state), FUPARAREF/FUNCT + DOCU_GET. HARD rule: it never test-calls
a candidate — snippets are text only. Read-only; deploys nothing.
Use for: "which BAPI/FM for X", find an API, is this BAPI released, API to
create/read/post <object>, discover function module, released API S/4.
`successor` (released→sanctioned replacement) is phase 2; `scan` is phase 3.
Prerequisites: an RFC-capable connection profile (/sap-login). No dev-init, no GUI.
Other plugins' skills for the same job