/sap-dev-core:sap-explain-object <OBJECT_NAME> [--type program|include|fm|class|auto] [--callers] [--no-gui] [--depth N] [--spec] [--format md|docx|xlsx] [--audience functional|technical]from sap-dev-core
Read-only comprehension aid for existing ABAP objects. Auto-detects type via RFC, resolves include trees, builds call/data maps, and emits explanation dossiers or formal spec documents (Markdown, Word, Excel).
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.
Produces a read-only "object dossier" for an existing ABAP object: what it does, its internal structure and call graph, the data it touches, its dependencies, and a change-impact note. Pure read — never deploys, activates, or edits.
With --spec the same comprehension base is upgraded into a formal,
review-ready specification document (Markdown / Word / a filled
spec_template.xlsx) — the inverse of /sap-gen-abap's spec-to-code flow. That
mode (Step 7.5) folds in the former /sap-document-object skill.
This skill observes shared/rules/skill_operating_rules.md (reads only — no SQL
writes, no unsolicited deployment).
| File / token | Path | Purpose |
|---|---|---|
sap_settings_lib.ps1 | <SAP_DEV_CORE_SHARED_DIR>\scripts\sap_settings_lib.ps1 | Get-SapSettingValue, settings merge |
sap_connection_lib.ps1 | <SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1 | Get-SapWorkDir, Get-SapCurrentSessionPath |
sap_rfc_lib.ps1 | <SAP_DEV_CORE_SHARED_DIR>\scripts\sap_rfc_lib.ps1 | Connect-SapRfc (+ the New-RfcReadTable / Add-RfcOption / Add-RfcField primitives) |
sap_object_resolver.ps1 | <SAP_DEV_CORE_SHARED_DIR>\scripts\sap_object_resolver.ps1 | Read-SapTableRows (validated RFC_READ_TABLE reader for the type probe; CLI body self-guarded on dot-source) |
sap_rfc_read_source.ps1 | <SAP_DEV_CORE_SHARED_DIR>\scripts\sap_rfc_read_source.ps1 | Read-SapAbapSource (RPY source + include tree) |
sap_explain_parse.ps1 | <SKILL_DIR>\references\sap_explain_parse.ps1 | offline source -> map.json |
sap_attach_lib.vbs (%%ATTACH_LIB_VBS%%) | <SAP_DEV_CORE_SHARED_DIR>\scripts\sap_attach_lib.vbs | AttachSapSession (GUI download / where-used) |
| SE24 download VBS | <SKILL_DIR>\..\sap-se24\references\sap_se24_check_and_download.vbs | class source (GUI) |
| where-used VBS | <SKILL_DIR>\..\sap-where-used-list\references\sap_where_used_list.vbs | callers (GUI) |
sap_object_resolver.ps1 (again) | <SAP_DEV_CORE_SHARED_DIR>\scripts\sap_object_resolver.ps1 | Read-SapTableRows for the --spec DD02T/DD03L/T100 enrichment |
spec_template.xlsx | <SAP_DEV_CORE_SHARED_DIR>\templates\spec_template.xlsx | (--spec --format xlsx) the 17-sheet layout filled from the enriched map — round-trips into /sap-docs-extract |
sap_log_helper.ps1 | <SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1 | structured logging |
Skills orchestrated in --spec mode (skills-first): anthropic-skills:docx
(--format docx), anthropic-skills:xlsx (--format xlsx).
Resolve work_dir via the env-aware helper (do NOT read settings.json
directly — that ignores SAPDEV_AI_WORK_DIR / userconfig.json):
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))"
Settings reads/writes follow shared/rules/settings_lookup.md.
| Setting | Default if blank |
|---|---|
work_dir | C:\sap_dev_work |
Set {WORK_TEMP} = {work_dir}\temp and {OUT} = {WORK_TEMP}\explain\{OBJECT}. Ensure {OUT} exists:
cmd /c if not exist "{OUT}" mkdir "{OUT}"
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))"
Write this run's generated scratch (explain_dl.vbs) and the _run.json log state under {RUN_TEMP}; keep {WORK_TEMP} (base) for {OUT} and Get-SapCurrentSessionPath -WorkTemp.
powershell -NoProfile -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_explain_object_run.json" -Skill sap-explain-object -ParamsJson "{\"args\":\"{RAW_ARGS}\"}"
The -StateFile carries the run_id between this start and the Final end event — pass the same path to both; no RUN_ID= capture is needed.
{OBJECT} = first positional, uppercased.--type -> {TYPE} (default auto).--callers -> {CALLERS} = true (default false; requires GUI session).--no-gui -> {NOGUI} = true (RFC-only; classes degrade to signature only).--depth N -> {DEPTH} (default 3).--spec -> {SPEC} = true (default false; activates the spec-document mode, Step 7.5).--format -> {FORMAT} (default md; md | docx | xlsx; only meaningful with --spec).--audience -> {AUDIENCE} (default technical; functional | technical; only with --spec)./sap-login). Verify by attempting
Connect-SapRfc (empty params -> pinned-profile fallback).{TYPE} resolves to class (source
download) or {CALLERS} is true. If needed and absent, instruct the user to
run /sap-login. If {NOGUI} is set, skip GUI entirely.If {TYPE} is auto, probe these tables in order via Read-SapTableRows and
stop at the first hit (the underlying New-RfcReadTable auto-applies
Assert-RfcReadTableAllowed):
| Table | Filter | -> Type |
|---|---|---|
TRDIR | NAME = '{OBJECT}' (SUBC: 1=report, I=include, M=module pool, F=FUGR main) | program / include |
TFDIR | FUNCNAME = '{OBJECT}' | fm |
SEOCLASS | CLSNAME = '{OBJECT}' | class / interface |
DD02L | TABNAME = '{OBJECT}' | table/structure (out of scope -> suggest /sap-se11; stop) |
DD01L / DD04L / DD40L | name match | domain / data element / table type (out of scope -> note) |
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_rfc_lib.ps1'
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_object_resolver.ps1' # Read-SapTableRows (CLI body self-guarded on dot-source)
$dest = Connect-SapRfc -DestName "EXPLAIN"
if (-not $dest) { Write-Output "ERROR: no RFC connection (run /sap-login)"; exit 2 }
# Use the validated reader Read-SapTableRows -Destination/-Table/-Where/-Fields. Do NOT
# hand-roll New-RfcReadTable -QueryTable/-Where/-Fields — that is not its signature
# (New-RfcReadTable takes only -Destination/-Table; WHERE/fields are added via
# Add-RfcOption/Add-RfcField). The underlying reader auto-applies Assert-RfcReadTableAllowed.
$rows = Read-SapTableRows -Destination $dest -Table "TRDIR" -Where "NAME = '{OBJECT}'" -Fields @("NAME","SUBC")
# $null -eq $rows -> RFC could-not-check ; $rows.Count -eq 0 -> not this type
# ...branch per the table above; emit TYPE={resolved}
If nothing matches -> ERROR: {OBJECT} not found as program/include/FM/class. and stop.
Programs / includes / FMs (RFC, preferred):
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_rfc_read_source.ps1'
$r = Read-SapAbapSource -Name '{OBJECT}' -Type '{TYPE}' -OutDir '{OUT}' -WithIncludes -Depth {DEPTH}
# $r.Status in OK | NOT_FOUND | UNSUPPORTED | ERROR
# $r.SourceFile = {OUT}\source.txt ; $r.Includes = @(@{Name;File}, ...)
Class / interface: RFC class source is not supported by the reader -> use the
SE24 GUI download VBS (skip if {NOGUI}):
$skillSe24 = '<SKILL_DIR>\..\sap-se24'
# BAKE the resolved session path into %%SESSION_PATH%% (attach Strategy 1): this
# generator is a SEPARATE process from the one that runs cscript, so an
# $env:SAPDEV_SESSION_PATH exported here dies with it and the attach lib silently
# falls through to its sole-connection default -- which is how a run pinned to one
# SAP system downloaded ANOTHER one's source under the same name (2026-08-06).
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'
$sessionPath = Get-SapCurrentSessionPath -WorkTemp '{WORK_TEMP}'
$vbs = ([System.IO.File]::ReadAllText("$skillSe24\references\sap_se24_check_and_download.vbs", [System.Text.Encoding]::UTF8)).
Replace('%%CLASS_NAME%%','{OBJECT}').
Replace('%%OUTPUT_FILE%%','{OUT}\source.txt').
Replace('%%SESSION_PATH%%',$sessionPath).
Replace('%%SYNTAX_CHECK_LIB_VBS%%','<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_syntax_check_lib.vbs').
Replace('%%ATTACH_LIB_VBS%%','<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_attach_lib.vbs')
[System.IO.File]::WriteAllText('{RUN_TEMP}\explain_dl.vbs', $vbs, [System.Text.UnicodeEncoding]::new($false, $true))
Run the download with the GUI target declared in the SAME block — the RFC readers
above and this GUI leg resolve their target through different chains, and the
GUI_TARGET: line the attach lib echoes is what tells you which system the source
actually came from:
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'
Set-SapGuiTargetExpectation -WorkTemp '{WORK_TEMP}' | Out-Null
& "C:/Windows/SysWOW64/cscript.exe" //NoLogo "{RUN_TEMP}\explain_dl.vbs"
Note: GUI download returns the pretty-printed display view (local
TYPESmay appear at outer scope). Adequate for comprehension; flag it in the dossier.
powershell -NoProfile -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_explain_parse.ps1" -SourceDir "{OUT}" -OutFile "{OUT}\map.json"
map.json (best-effort; per-unit DB attribution is a refinement):
{ "object":"{OBJECT}","type":"{TYPE}","includes":["..."],
"units":[{"kind":"FORM|METHOD|FUNCTION","name":"..."}],
"externals":{"function_modules":["..."],"performs":["..."],
"submits":["..."],"transactions":["..."]},
"db_reads":["MARA"],"db_writes":["ZTAB"],
"selection_screen":[{"name":"P_WERKS","kind":"PARAMETER"}] }
--callers)Instantiate the where-used VBS (TXN by {TYPE}: SE38/SE37/SE24), tokens
%%TXN%% %%OBJECT_TYPE%% %%OBJECT_NAME%% %%TO_SPOOL%% %%SESSION_LOCK_VBS%% %%SESSION_PATH%% %%ATTACH_LIB_VBS%%; substitute $env:SAPDEV_SESSION_PATH via
Get-SapCurrentSessionPath -WorkTemp '{WORK_TEMP}'; parse last line:
NOT_FOUND: -> no callersFOUND_LIST: -> list on screen (note to user)SPOOL_CREATED:<n> -> chain /sap-sp02 <n> {OUT}\callers.txt to downloadINCONCLUSIVE: [<type>] … -- <msg> -> callers UNKNOWN, not zero and not many.
SAP answered with a message instead of a list; record the message and say the
caller set could not be established — never render it as "has callers" or as
"no callers" in dossier.md.
Merge results into map.json under callers.dossier.mdRead {OUT}\map.json and {OUT}\source.txt. Write {OUT}\dossier.md:
--callers.--spec only)Skip this entire section unless --spec was passed. In spec mode you upgrade
the Step-7 dossier into a formal, review-ready specification document — the
inverse of /sap-gen-abap's spec-to-code flow, and a customer-grade deliverable
rather than a developer dossier. (This folds in the former /sap-document-object
skill.) Still read-only.
Deepen {OUT}\map.json with system-confirmed detail, writing {OUT}\enriched.json.
RFC-optional — a read failure degrades that section to COULD_NOT_CHECK, never a
silent gap. Use Read-SapTableRows (from sap_object_resolver.ps1, already
dot-sourced in Step 3) — do NOT hand-roll New-RfcReadTable -QueryTable/-Where/-Fields
(not its signature; WHERE/fields go through Add-RfcOption/Add-RfcField).
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_rfc_lib.ps1'
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_object_resolver.ps1' # Read-SapTableRows
$dest = Connect-SapRfc -DestName "EXPLAIN" # creds fall back to pinned profile
$keys = Read-SapTableRows -Destination $dest -Table 'DD03L' `
-Where "TABNAME = '<T>' AND KEYFLAG = 'X'" -Fields @('FIELDNAME','ROLLNAME')
| Enrichment | Source | Use |
|---|---|---|
| Table short text | DD02T (TABNAME, DDLANGUAGE) | Data-model section: human name per table. Language fallback required — try the logon language first, then any (… WHERE TABNAME = '<T>', first row). Custom tables often carry text only in the author's language (JA/ZH); mark COULD_NOT_CHECK only if no language row exists. |
| Table key fields | DD03L (TABNAME, KEYFLAG='X') | Data-model section: keys per table |
| Message texts | T100 (SPRSL, ARBGB = msg class, MSGNR) | Messages section: text per MESSAGE referenced in source |
| Authorization objects | the AUTHORITY-CHECK OBJECT '…' literals in source.txt | Authorizations section |
| Callers | from --callers (map.json.callers) | Dependencies / change-impact |
(Read-SapTableRows / the underlying New-RfcReadTable auto-apply
Assert-RfcReadTableAllowed — never read REPOSRC.)
Write {OUT}\{OBJECT}.spec.md. Mark each section CONFIRMED (read from the
system) or INFERRED (reasoned). Omit sections N/A for the object type; trim
internals for --audience functional:
map.json units + call graph.--callers.AUTHORITY-CHECK object found.SY-SUBRC handling, MESSAGE types.CALL FUNCTION lv_, dynamic SELECT,
SUBMIT (rep)); class source is the pretty-print display view; any
COULD_NOT_CHECK enrichment.--format)md (default) — the .spec.md from 7.5b is the deliverable.
docx — invoke anthropic-skills:docx to render {OBJECT}.spec.md into
{OUT}\{OBJECT}.spec.docx (sign-off Word: heading styles + the data-model /
messages / dependencies tables).
xlsx — invoke anthropic-skills:xlsx to copy spec_template.xlsx and fill
it from enriched.json so the result round-trips through /sap-docs-extract:
| spec_template sheet | Filled from |
|---|---|
| Cover | object name / type / package / system |
| Selection Definition / Selection Screen | map.json.selection_screen |
| Tables | db_reads / db_writes + DD02T text |
| Data Elements | data elements behind selection params / key fields |
| Error Messages | T100 enrichment |
| Processing Flow | the 7.5b §3 narrative |
| Dependencies | externals + callers |
Sheets with no source data are left as the template prompts; list every unmapped sheet in the run summary (do not imply a full spec).
The spec is a draft for human review, not authoritative — say so in the summary.
Print the {OUT} path and a 5-line summary. In --spec mode also name the spec
deliverable (.spec.md / .spec.docx / filled spec_template.xlsx), the
confirmed-vs-inferred balance, and any COULD_NOT_CHECK enrichment or unmapped
xlsx sheets — stating plainly it is a draft for human review. Leave {OUT}
artifacts in place (read-only deliverable). Remove only scratch VBS in {RUN_TEMP}.
powershell -NoProfile -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_explain_object_run.json" -Status SUCCESS -ExitCode 0
(On failure use -Status FAILED -ExitCode 1; for the not-found path add -ErrorClass OBJECT_NOT_FOUND. -Status must be one of SUCCESS|FAILED|SKIPPED|EXISTED|ABANDONED.)
| Symptom | Cause | Fix |
|---|---|---|
ERROR: no RFC connection | not logged in / RFC creds missing | run /sap-login |
Read-SapAbapSource Status=UNSUPPORTED | class over RFC | omit --no-gui; ensure GUI session |
| include tree shallow | depth cap | raise --depth |
| class source scope looks off | pretty-print display view | expected; treat source as informational |
/sap-se11 display.CALL FUNCTION lv_name, CALL METHOD (lv_meth)) and dynamic where-used refs aren't resolved — noted in the dossier.--spec produces a DRAFT, not ground truth. Purpose and processing narrative
are inferred and flagged as such — for human review, not sign-off without it.--spec DDIC / message enrichment is RFC-optional — degrades to COULD_NOT_CHECK.--spec --format xlsx fidelity is best-effort — only sheets with a clear map
source are filled; unmapped sheets are reported, never silently left looking complete.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sap, abap, code-analysis, reverse-engineering, documentation
61 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.
/sap-atcRuns 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 that set, polls the ATC Run Monitor until the
run completes, then reads the Priority 1 / Priority 2 / Priority 3
finding counts from the Manage Results screen and (best-effort)
downloads the result text file. Applies the customer brief's
MAX_PRIORITY threshold to decide pass / fail.
Replaces the legacy SCI-results-tree implementation that lacked a
Priority column. Per-stage VBS references are recorded against the
S/4HANA 1909 ATC layout — re-record on first failure with
/sap-gui-probe --record if your release uses different tree node IDs / grid
column IDs.
Prerequisites: Active SAP GUI session (use /sap-login first).
/sap-call-bdcExecutes BDC (Batch Data Communication) sessions in SAP via RFC.
Reads SHDB recording files from the bdc/ folder, connects via
SAP NCo 3.1, calls ABAP4_CALL_TRANSACTION, and outputs
full BDCMSGCOLL messages to a result file.
Connection parameters resolved from the AI session's pinned profile in
connections.json (saved via /sap-login).
Prerequisites: SAP profile saved via /sap-login (RFC password required).
SAP NCo 3.1 (32-bit, .NET 4.0) in GAC.
/sap-change-packageChanges the package (TADIR-DEVCLASS) assignment of an SAP repository object
via the "Object Directory Entry" dialog (Goto > Object Directory Entry).
Routes by object type to SE38 / SE37 / SE24 / SE11 / SE91 / CMOD (the last
for enhancement projects — used by /sap-cmod). Handles three
flows automatically based on current vs new package locality:
(a) $TMP → transportable (Z*/Y*): resolves a modifiable TR via
/sap-transport-request, then enters the new package + TR.
(b) transportable A → transportable B: pre-checks E071/E070 to ensure
the object is NOT linked to a modifiable TR (would block the move).
(c) transportable → $TMP: confirms the move and presses "Local object".
Verifies via TADIR re-query.
Prerequisites: Active SAP GUI session (use /sap-login first).
/sap-check-abapValidates ABAP source (report / program / FM / class / include) before
deployment — one skill, dimension-dispatched: naming (variable conventions),
type (DDIC type validity), unused (dead variables), sql (SELECT/UPDATE/DELETE
fields vs table defs), contract (offline generation rules), spec (offline: code
covers every dependency / message / text / selection field in the design spec),
fm (CALL FUNCTION params / sections / types vs the live FM over RFC — absorbed
from the former sap-check-fm), syntax (compiler-level EDITOR_SYNTAX_CHECK via
RFC, catching real errors offline before any GUI upload). Writes tab-delimited
result files with fix advice; feed findings to /sap-fix-abap. SAP connection
optional — offline skips type/sql/fm/syntax; live dimensions that can't run
report COULD_NOT_CHECK, never a silent pass.
Prerequisites: SAP GUI (SAP.Functions COM); SAP NCo 3.1 (32-bit) + the dev-init
wrapper Z_GENERIC_RFC_WRAPPER_TBL for the syntax dimension.
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-dev-coreOther plugins' skills for the same job