/sap-dev-core:sap-se16n <TABLE> [field=value ...] [select=F1,F2,...] | snapshot save <name> <TABLE> [filters] --keys=K1,K2 [--ignore=V1,V2] | snapshot diff <a> <b> [--keys=..] [--ignore=..] | snapshot listfrom sap-dev-core
Queries SAP tables via SE16N using GUI Scripting, downloads results as tab-delimited text, and supports snapshot save/diff for table-state assertions.
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 query a SAP table via transaction SE16N and download the result set as a tab-delimited text file. Filters and the optional output-field list are passed to the underlying VBScript via a side-channel parameters file so that an arbitrary number of filter fields and values can be specified.
Task: $ARGUMENTS
Mode dispatch. If the first token is snapshot, go to Snapshot Modes
(below): save runs the normal query flow (Steps 0–6) then captures the result;
diff / list are pure-local and skip the SAP query. If the first token is
agg, go to Aggregation Mode (SE16H) — server-side GROUP BY + MIN/MAX/AVG +
per-group count, a separate SAP flow (transaction SE16H) that does NOT run
Steps 3–6. Any other first token is the normal query flow (Steps 0–6,
default — unchanged).
| File | Purpose |
|---|---|
<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 + DDIC field name, status-bar checks via MessageType codes (S/W/E/I/A), VKey instead of menu-text, no branching on .Text/.Tooltip/window titles |
<SKILL_DIR>/references/sap_se16n_snapshot.ps1 | Snapshot save/diff/list (pure-local); the diff delegates to the shared keyed-diff engine. |
<SKILL_DIR>/references/sap_se16h_agg.vbs | agg mode — drives SE16H (program SAPLSE16N, advanced screen) for server-side GROUP BY + MIN/MAX/AVG; reads the grouped ALV via the GridView API (no export dialog). Tokens: %%TABLE_NAME%%, %%PARAMS_FILE%%, %%OUTPUT_FILE%%, %%MAX_GROUPS%%, %%MIN_COUNT%%, %%SESSION_PATH%%, %%ATTACH_LIB_VBS%%. |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_keyed_diff_lib.ps1 | The ONE keyed row-diff engine (Get-SapKeyedDiff / Write-SapKeyedDiffTsv), shared with /sap-config-compare + /sap-compare --table-content. |
Resolve work_dir via the env-aware helper — do NOT take work_dir from a direct settings.json read (that ignores the SAPDEV_AI_WORK_DIR env var and userconfig.json). Use the WORK_DIR= value printed by:
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))"
The settings note below still applies to the OTHER keys.
Settings reads/writes follow shared/rules/settings_lookup.md — merge per-key on the .value field (env var → settings.local.json → userconfig.json → settings.json); non-per-connection writes go to userconfig.json. Resolve sap-dev-core paths: 2 levels up from <SKILL_DIR> to the plugin root, then settings.json and (if present) settings.local.json. Read custom_url.
| Setting | Default if blank |
|---|---|
work_dir | C:\sap_dev_work |
custom_url | {work_dir}\custom |
Set {WORK_TEMP} = {work_dir}\temp
Ensure the temp directory exists:
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
invocation; it isolates this run's generated wrappers / state / scratch files so
concurrent runs (parallel sub-agents, multi-connection deploys) never collide.
{WORK_TEMP} stays the base temp dir and is used ONLY for
Get-SapCurrentSessionPath -WorkTemp '{WORK_TEMP}' (the session-attach plumbing
derives {work_dir}\runtime from its parent, so it must see the base path, not
the run dir). Everything the skill writes itself goes under {RUN_TEMP}.
Start a structured log run. State file: {RUN_TEMP}\sap_se16n_run.json. Best-effort.
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_se16n_run.json" -Skill sap-se16n -ParamsJson "{\"table\":\"<TABLE>\"}"
| Parameter | Description | Example |
|---|---|---|
| Table name | SAP transparent / pooled / cluster table | T001 |
| Filter fields | Zero or more field op value(s) triples — see operator table | LAND1 IN CN,JP |
| Select fields | Optional comma-separated list of output columns; empty = all fields | BUKRS,BUTXT,LAND1,WAERS |
| Output file | Absolute path of the resulting .txt file (default: {RUN_TEMP}\se16n_<TABLE>.txt) |
Operators (column 2 of each FILTER row):
| Op | Meaning | Values column count |
|---|---|---|
EQ | equals | 1 |
NE | not equal | 1 |
GT / LT / GE / LE | comparison | 1 |
BT | between (LOW..HIGH) | 2 |
NB | not between | 2 |
CP | matches pattern (*, +) | 1 |
NP | does not match pattern | 1 |
IN | one of the listed values | 2..N (auto-uses multi-select popup) |
Routing rule: an IN operator OR a single filter with more than one value
opens the SE16N multi-select popup (btnPUSH) and fills the LOW column of
tblSAPLSE16NMULTI_TC. A single value with any other operator is set directly
on ctxtGS_SELFIELDS-LOW of the criteria row.
If the user gives the criteria as natural language (e.g. "T001 where Country is CN or JP and Currency is CNY"), parse to:
| Field | Op | Values |
|---|---|---|
LAND1 | IN | CN, JP |
WAERS | EQ | CNY |
This skill requires an active SAP GUI session. If not already logged in, use
the /sap-login skill first, then return here.
Write {RUN_TEMP}\se16n_params.txt with two literal section headers, SELECT
and FILTER, each followed by its rows. Either section may be empty.
Format:
SELECT
<FIELDNAME>
<FIELDNAME>
FILTER
<FIELDNAME><TAB><OP><TAB><VAL1>[<TAB><VAL2>...]
<FIELDNAME><TAB><OP><TAB><VAL1>[<TAB><VAL2>...]
Field columns are separated by a real tab character (\t) — not spaces.
Example for T001 filter LAND1 ∈ {CN, JP} AND WAERS = CNY, returning all
fields:
SELECT
FILTER
LAND1 IN CN JP
WAERS EQ CNY
Same query but only outputting BUKRS, BUTXT, LAND1, WAERS:
SELECT
BUKRS
BUTXT
LAND1
WAERS
FILTER
LAND1 IN CN JP
WAERS EQ CNY
Use the Write tool to create the file. The VBS reads it as system default codepage; ASCII is always safe.
The VBS template is at ./references/sap_se16n.vbs.
Write {RUN_TEMP}\sap_se16n_run.ps1:
$content = [System.IO.File]::ReadAllText('<SKILL_DIR>\references\sap_se16n.vbs', [System.Text.Encoding]::UTF8)
$content = $content -replace '%%TABLE_NAME%%','THE_TABLE'
$content = $content -replace '%%PARAMS_FILE%%','{RUN_TEMP}\se16n_params.txt'
$content = $content -replace '%%OUTPUT_FILE%%','{RUN_TEMP}\se16n_THE_TABLE.txt'
# Session-attach plumbing (Phase 4.2: pin file eliminated). The shared
# AttachSapSession helper resolves the target session in this order:
# 1. SESSION_PATH constant (set from the parsed --session argument)
# 2. SAPDEV_SESSION_PATH env var
# 3. Sole-connection + sole-session auto-default
# 4. Refuse with helpful error (multiple connections, no resolver)
# Resolve the AI-session's pin here and BAKE it into %%SESSION_PATH%% (Strategy 1).
# Do NOT export it as $env:SAPDEV_SESSION_PATH instead (Strategy 2): 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 Strategy 3 --
# which on a machine with two SAP GUIs open reads the wrong system (2026-08-06).
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'
$sessionPath = '' # set to the parsed --session value if supplied
if (-not $sessionPath) { $sessionPath = Get-SapCurrentSessionPath -WorkTemp '{WORK_TEMP}' }
$content = $content.Replace('%%SESSION_PATH%%', $sessionPath)
$content = $content -replace '%%ATTACH_LIB_VBS%%','<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_attach_lib.vbs'
[System.IO.File]::WriteAllText('{RUN_TEMP}\sap_se16n_run.vbs', $content, [System.Text.UnicodeEncoding]::new($false, $true))
Write-Host ("Done (session_path='" + $sessionPath + "')")
Replace THE_TABLE with the actual table name (UPPERCASE) and <SKILL_DIR> /
{WORK_TEMP} with their absolute paths.
Run:
powershell -ExecutionPolicy Bypass -File "{RUN_TEMP}\sap_se16n_run.ps1"
SE16N's "download to local file" is SAP-GUI-side file IO, so it raises the
modal SAP GUI Security dialog when the output path isn't allow-listed (Default
Action = Ask) — and that modal suspends the Scripting API, hanging the cscript.
Per shared/rules/sap_gui_security_handling.md, pre-check the rules and run the
OS-level watcher around the export. Run as one PowerShell block (the 32-bit
cscript is inside it). Substitute THE_SID / THE_CLIENT with the pinned
system / client:
$shared = '<SAP_DEV_CORE_SHARED_DIR>\scripts'
$out = '{RUN_TEMP}\se16n_THE_TABLE.txt'
# 0. Declare which SAP system the GUI leg may read. MUST happen in THIS block:
# the attach lib reads it from the process environment, and cscript is a child
# of THIS PowerShell. Table data with no provenance is exactly the 2026-08-06
# failure mode -- a dump labelled "THE_TABLE on <SID>" that came from another
# system is worse than no dump at all.
. "$shared\sap_connection_lib.ps1"
Set-SapGuiTargetExpectation -WorkTemp '{WORK_TEMP}' | Out-Null
# 1. Pre-check the allow-list (read-only; informational + lets us skip the watcher).
& "$shared\sap_gui_security_precheck.ps1" -Path $out -Access w -System 'THE_SID' -Client 'THE_CLIENT' -Transaction 'SE16N' | Out-Host
$allowed = ($LASTEXITCODE -eq 0)
# 2. If not already allow-listed, launch the OS-level watcher BEFORE the
# (blocking) export. It detects the #32770 dialog and clicks Remember+Allow,
# which also persists a rule so subsequent runs pre-check ALLOWED.
$watcher = $null
if (-not $allowed) {
$watcher = Start-Process powershell -PassThru -WindowStyle Hidden -ArgumentList @(
'-NoProfile','-ExecutionPolicy','Bypass','-File',"$shared\sap_gui_security_sidecar.ps1",'-TimeoutSeconds','40')
Start-Sleep -Milliseconds 800
}
# 3. Run the export (32-bit cscript). If the dialog appears it blocks here until
# the watcher dismisses it; then the export completes.
& 'C:/Windows/SysWOW64/cscript.exe' //NoLogo '{RUN_TEMP}\sap_se16n_run.vbs'
# 4. Reap the watcher.
if ($watcher) { $watcher | Wait-Process -Timeout 45 -ErrorAction SilentlyContinue }
Last line of stdout:
| Last line | Meaning |
|---|---|
ROWS=<n> (n ≥ 1) | Query returned n data rows. Output file is tab-delimited with a header line. |
ROWS=0 (NO_DATA) | Genuine empty result set ("no values found"). Exit 0. Output file contains a single line NO_DATA<TAB><status text>. |
QUERY_FAILED | The query FAILED — authorization error, invalid/forbidden table, or any status-bar error (MessageType E/A) after the table-name Enter or F8. Exit 1. Output file's first line is QUERY_FAILED<TAB><status text>. This is NOT "0 rows". Consumers MUST treat it as an error, never as "row/object absent" (see the consumer note below). |
ERROR: … | Navigation / layout / file-write failure — show the full output and stop. |
QUERY_FAILED vs NO_DATA — the critical distinction. An authorization failure,
a forbidden table, or an sbar error leaves no result ALV — exactly like a genuine
empty result set does. The VBS branches on the locale-independent sbar.MessageType
(E/A → QUERY_FAILED + exit 1; otherwise → NO_DATA + exit 0), never on the
translated status text. Callers that read E070/E071 via this skill (e.g.
/sap-transport-request Step 1b, /sap-se01 release/delete pre-checks,
/sap-cc-inventory GUI ingest) previously read an auth failure as "TR/object not
found" and could steer to a new TR or proceed on an empty inventory — they now
distinguish QUERY_FAILED and fail closed.
Output file ({RUN_TEMP}\se16n_<TABLE>.txt):
If you need to summarise the result for the user, read the first ~20 lines and report the row count and a few sample rows.
Report back to the user:
Pure-local aside from save's underlying query. Resolve {artifact_dir} (default
{work_dir}\artifacts) in Step 0 and set {SNAP_ROOT} = {artifact_dir}\snapshots.
Helper: references/sap_se16n_snapshot.ps1; diff engine: the shared
sap_keyed_diff_lib.ps1.
snapshot save <name> <TABLE> [filters] --keys=K1,K2 [--ignore=V1,V2] [select=...]<TABLE> + filters to produce the
TSV at {RUN_TEMP}\se16n_<TABLE>.txt. Ensure the --keys (and any --ignore
volatile) columns are in the select= list so they are present to diff on.QUERY_FAILED / NO_DATA export — fix the query first):
powershell -NoProfile -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_se16n_snapshot.ps1" -Action save -SnapshotRoot "{SNAP_ROOT}" -Name "<name>" -DataTsv "{RUN_TEMP}\se16n_<TABLE>.txt" -Table "<TABLE>" -Filters "<filters>" -KeyColumns "K1,K2" -IgnoreColumns "V1,V2" -Sid "<SID>" -Client "<client>"
Report the STATUS: SAVED … line.snapshot diff <a> <b> [--keys=..] [--ignore=..]Pure-local — no SAP session. Keys/ignore default to the snapshots' saved metadata when omitted:
powershell -NoProfile -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_se16n_snapshot.ps1" -Action diff -SnapshotRoot "{SNAP_ROOT}" -Left "<a>" -Right "<b>" -KeyColumns "K1,K2" -IgnoreColumns "V1,V2" -KeyedDiffLib "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_keyed_diff_lib.ps1"
Surface the KEYED_DIFF: added=.. removed=.. changed=.. same=.. line and the diff_<a>_vs_<b>.tsv path; register it via Register-SapArtifact -Kind diff. A schema_drift= / dup_keys= tail is a data-quality flag to report, never hide. It refuses a cross-table diff.
snapshot listpowershell -NoProfile -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_se16n_snapshot.ps1" -Action list -SnapshotRoot "{SNAP_ROOT}"
agg <TABLE> --group-by=F1[,F2…] [--avg=A] [--min=B] [--max=C] [--count] [--sum=D] [--filter FIELD OP VALUE …] [--max-groups=N] [--min-count=M]
Pushes the aggregation down to the database via transaction SE16H (program
SAPLSE16N, the "General Table Display" advanced screen) so the raw rows are
never downloaded. Drives references/sap_se16h_agg.vbs, which ticks GROUP BY on
the --group-by fields, sets the aggregate combo on each --avg/--min/--max
field, executes, and reads the grouped ALV directly through the GridView API — so
no ALV export dialog fires, hence no SAP GUI Security file-IO prompt.
Capability — verified live (S/4HANA 1909, SAP_BASIS 754, 2026-07-11): SE16H's
per-field aggregate combo offers only MIN / MAX / AVG. There is no
Sum/Total in the combo on this build, across CHAR / NUMC / INT / CURR fields and
whether or not a GROUP BY is active. COUNT is implicit — a grouped result
always carries a LINE_INDEX ("Number of Entries") column, which --count simply
surfaces (it is always present; the flag only documents intent).
--sum is NOT server-side here. SE16H cannot sum. Route --sum=<field> to a
local-aggregation fallback: run the normal query flow (Steps 0–6) for
<TABLE> + the same --group-by/--filter (with the sum field + group keys in
select=), then sum locally per group — and print the raw row count with an
explicit "summed locally over N downloaded rows (server-side SUM unavailable in
SE16H)" warning, since a large table means a large download. Never silently
approximate SUM from AVG × COUNT (SQL AVG is rounded → wrong for currency).Flow:
--group-by (comma list), the aggregate specs
(--avg/--min/--max → field:func with func ∈ MIN/MAX/AVG), --filter
triples, --max-groups (default 100000), --min-count (grouping minimum).
If --sum is present, peel it off and handle it via the local fallback above
(the SE16H run still handles any MIN/MAX/AVG/group asked alongside it).{RUN_TEMP}\se16h_agg_params.txt (system codepage),
sections introduced by the literal lines GROUP / AGG / FILTER:
GROUP
WERKS
BWART
AGG
MENGE AVG
FILTER
BWART EQ 101
(AGG rows are FIELD<TAB>FUNC; FILTER rows are FIELD<TAB>OP<TAB>value…
with SE16N operators EQ/NE/GT/LT/GE/LE/BT/NB/CP/NP/IN.)$sessionPath and BAKE it into %%SESSION_PATH%%, write UTF-16LE, run
32-bit cscript):
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'
$sessionPath = Get-SapCurrentSessionPath -WorkTemp '{WORK_TEMP}'
$c = [System.IO.File]::ReadAllText('<SKILL_DIR>\references\sap_se16h_agg.vbs', [System.Text.Encoding]::UTF8)
$c = $c -replace '%%TABLE_NAME%%','<TABLE>'
$c = $c -replace '%%PARAMS_FILE%%','{RUN_TEMP}\se16h_agg_params.txt'
$c = $c -replace '%%OUTPUT_FILE%%','{RUN_TEMP}\se16h_agg_<TABLE>.txt'
$c = $c -replace '%%MAX_GROUPS%%','100000'
$c = $c -replace '%%MIN_COUNT%%',''
$c = $c.Replace('%%SESSION_PATH%%', $sessionPath)
$c = $c -replace '%%ATTACH_LIB_VBS%%','<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_attach_lib.vbs'
[System.IO.File]::WriteAllText('{RUN_TEMP}\sap_se16h_agg_run.vbs', $c, [System.Text.UnicodeEncoding]::new($false,$true))
Declare the GUI target in the SAME block as cscript, so the aggregate is read
from the system the RFC leg resolved and the GUI_TARGET: line proves it:
. '<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}\sap_se16h_agg_run.vbs'
SE16H_AGG: table=.. groups=<n> cols=<c> truncated=<0|1> group_by=[..] agg=[..]
then ROWS=<n> then STATUS: OK — the grouped TSV is at the output path
(columns = group dims + aggregated measures + LINE_INDEX count). Register it
via Register-SapArtifact -Kind agg.truncated=1 ⇒ the group set was capped at --max-groups; say so
explicitly (some groups are missing — raise --max-groups for the full set).
GD-MAX_LINES caps the number of returned GROUPS, not the input: every
returned aggregate is still computed over the whole table, but excess groups
are dropped, so a silent partial pass is never acceptable.STATUS: TABLE_NOT_FOUND / FIELD_NOT_FOUND / AGG_NOT_APPLICABLE
(field type rejects the func, or a SUM/COUNT reached the VBS) / NO_RESULT_GRID
— surface the specific failure; do not read any of these as "0 groups".STATUS: COULD_NOT_CHECK reason=SE16H_outline_controls_absent (or
_selection_screen_absent) — SE16H or its outline model is unavailable on this
release/auth. Do not fail silently: offer the --sum-style local-
aggregation fallback (download via the normal flow, group locally, warn on row
count) for the whole request.Log the run-end record. Best-effort.
On success:
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_se16n_run.json" -Status SUCCESS -ExitCode 0
On failure:
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_se16n_run.json" -Status FAILED -ExitCode 1 -ErrorClass <CLASS> -ErrorMsg "<short>"
Suggested <CLASS>: SE16N_FAILED, TABLE_NOT_FOUND, GUI_TIMEOUT.
Selection-criteria table control: wnd[0]/usr/tblSAPLSE16NSELFIELDS_TC
| Col | ID prefix | Purpose |
|---|---|---|
| 0 | txtGS_SELFIELDS-SCRTEXT_M | Field description ("Fld name") |
| 1 | btnOPTION | Operator icon button |
| 2 | ctxtGS_SELFIELDS-LOW | From value |
| 3 | ctxtGS_SELFIELDS-HIGH | To value |
| 4 | btnPUSH | Multi-select popup launcher |
| 5 | chkGS_SELFIELDS-MARK | Output column checkbox |
| 6 | txtGS_SELFIELDS-FIELDNAME | Technical field name |
Multi-select popup: wnd[1]/usr/tblSAPLSE16NMULTI_TC/ctxtGS_MULTI_SELECT-LOW[1,n],
applied with wnd[1]/tbar[0]/btn[8] (Copy).
Execute: wnd[0]/tbar[1]/btn[8] (F8).
ALV export: pressToolbarContextButton "&MB_EXPORT" then
selectContextMenuItem "&PC". Format radios are at
wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[col,0]
(note: [col,0], not [col,row]):
| col | Label (S/4HANA 1909, EN) |
|---|---|
| 0 | Unconverted |
| 1 | Text with Tabs ← tab-delimited |
| 2 | Rich text format |
| 3 | HTML Format |
| 4 | In the clipboard |
Older releases label [1,0] as "Spreadsheet". The VBS walks the radios at
runtime and matches Tab or preadsheet substrings, then falls back to
[1,0]. File dialog: wnd[1]/usr/ctxtDY_PATH and wnd[1]/usr/ctxtDY_FILENAME.
agg mode) — same TC, different columnsTransaction SE16H shares program SAPLSE16N but its selection-field table
control (wnd[0]/usr/tblSAPLSE16NSELFIELDS_TC) exposes MORE columns than SE16N,
so the column indices differ — captured live on S/4HANA 1909, kernel 754:
| Col | ID prefix | Purpose |
|---|---|---|
| 2 | ctxtGS_SELFIELDS-LOW | From value (filter) |
| 3 | ctxtGS_SELFIELDS-HIGH | To value (filter) |
| 4 | btnPUSH | Multi-select popup launcher |
| 6 | chkGS_SELFIELDS-MARK | Output column checkbox |
| 8 | chkGS_SELFIELDS-GROUP_BY | Group-by checkbox |
| 10 | chkGS_SELFIELDS-ORDER_BY | Order-by checkbox |
| 12 | cmbGS_SELFIELDS-AGGREGATE | Aggregate combo — keys MIN/MAX/AVG (no SUM) |
| 13 | txtGS_SELFIELDS-FIELDNAME | Technical field name (col 6 in plain SE16N) |
Selection-screen scalars: table wnd[0]/usr/ctxtGD-TAB, returned-group cap
wnd[0]/usr/txtGD-MAX_LINES, grouping minimum wnd[0]/usr/txtGD-MIN_COUNT.
Execute wnd[0]/tbar[1]/btn[8] (F8) → result ALV wnd[0]/usr/cntlRESULT_LIST/shellcont/shell
(read via ColumnOrder + GetCellValue; the LINE_INDEX column is the implicit
per-group count). The field-list TC scrolls (verified to 30 rows); the VBS pages
verticalScrollbar to reach fields past the visible ~14.
agg mode
(SE16H: GROUP BY + MIN/MAX/AVG + per-group count); SUM is not server-side in
SE16H and falls back to a local sum over a full download (row-count warning).SELECT list filters output columns by toggling MARK checkboxes; column
ordering in the output file follows SAP's natural ordering, not the order in
the SELECT list.QUERY_FAILED (sbar MessageType E/A,
exit 1) — not NO_DATA. Surface the message to the user; do not treat it
as "0 rows".SE16) or
the selection-criteria table control / export dialog uses different control
IDs, so this skill may not be portable there. /sap-se01's create + verify
chain depends on SE16N (E070/E07T reads) — on ECC6 prefer the RFC path
(RFC_READ_TABLE / sap_tr_object_entries.ps1) where a helper exists, and
re-record the SE16N control IDs with /sap-gui-probe --record if the GUI path is
required.YYYYMMDD (e.g. 20240131) — SAP DATS
fields accept this regardless of the logon user's date personalization
(USR01-DATFM), so it is locale-independent. Do NOT use a separator form such
as YYYY.MM.DD, which is only accepted when it matches the user's DATFM.
Numeric values must have no thousand separators.AS4TEXT on E070, STEXT on
many tables) cannot be filtered via SE16N at all — SAP renders the row
greyed-out (no operator, no input, no multi-select). The skill detects this
via Changeable=False, prints a WARN: message, automatically adds the
field to the SELECT list, and continues with the remaining filters. The user
must post-filter the output file for the skipped condition.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.
/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.
Other plugins' skills for the same job