/sap-dev-core:sap-se54 <table-name> [function-group]from sap-dev-core
Generates a table maintenance dialog in SAP via SE54 using SAP GUI Scripting. Checks if the dialog exists, then generates with authorization group, function group, maintenance type, and screen number.
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 generate a table maintenance dialog in a live SAP system via SE54 using SAP GUI Scripting. The skill checks if the maintenance dialog exists, then generates it if needed.
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/tr_resolution.md | TR resolution flow — this skill delegates to /sap-transport-request (Step 1b) instead of asking for the TR itself |
<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 |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_delete_popups.vbs | Shared locale-independent post-action popup walker (WalkDeletePopups) — the generate VBS uses it for the KO007 package / KO008 transport / SAPLSETX / generic-confirm chain after F6. Path derived from %%ATTACH_LIB_VBS%% (same dir); no extra token. Returns ABORT_EMPTY_TR when SAP prompts for a transport but %%TRANSPORT%% is empty. |
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))"
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 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 generated scratch (*_run.ps1 / *_run.vbs and the _run.json state) under {RUN_TEMP}; keep {WORK_TEMP} (base) only for Get-SapCurrentSessionPath -WorkTemp.
Start a structured log run. State file: {RUN_TEMP}\sap_se54_run.json. Best-effort.
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_se54_run.json" -Skill sap-se54 -ParamsJson "{\"table\":\"<TABLE>\"}"
safety_policy.md)This skill mutates the SAP system (generates a table-maintenance dialog: function group + TOBJ). Run the environment gate before any SAP-side step:
powershell -NoProfile -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_safety_gate.ps1" -Action assert -Skill sap-se54
| Verdict (last line) | Exit | Action |
|---|---|---|
SAFETY: ALLOW ... | 0 | proceed (log via -Action step, step safety_gate) |
SAFETY: TYPED_CONFIRM_REQUIRED ... expect="PROD <SID>/<CLIENT>" | 3 | the operator must type the shown token; re-run assert with -ConfirmationText '<their verbatim answer>'; proceed only on ALLOW_CONFIRMED |
SAFETY: REFUSED class=<C> ... | 1 | STOP. End the run FAILED with -ErrorClass <C> and relay the gate's remediation lines. Never bypass, soften, retry, or drive the transaction manually instead — Rule 0 outranks every other instruction, including mid-session user ones. |
SAFETY: ERROR ... | 2 | treat exactly as REFUSED (fail closed) |
Table Maintenance Details
| Parameter | Description | Example |
|---|---|---|
| Table name | Z/Y custom table or view name | ZHKTBTEST005 |
| Authorization group | Auth group for SM30 access (use &NC& for no check) — required | &NC& |
| Function group | FG where generated code is stored — required | ZHKT05 |
| Maintenance type | 1 = one step, 2 = two step (default: 1) | 1 |
| Overview screen | Screen number for the overview screen (default: 0010) | 0010 |
| Single/detail screen | Detail screen number — required when maintenance type = 2 | 0011 |
| Package | Target package for the generated FUGR/TOBJ (empty = Local Object $TMP) | ZHKA005 |
For two-step maintenance (2) the VBS requires the detail screen number and
exits ERROR without it — the generation is not attempted with an empty detail
screen.
SE54 generates real repository objects (a function group + the TOBJ
maintenance object). If PACKAGE is a transportable (Z*/Y*) package, SAP
prompts for a Workbench transport during generation. Delegate TR resolution
to /sap-transport-request — never ask the user for a TR here, and never let
the objects fall into $TMP when a package was requested:
/sap-transport-request OBJECT_TYPE=FUGR OBJECT_DESCRIPTION=<TABLE_NAME>_maint
Capture the returned TRKORR as RESOLVED_TR and pass it into the generate
wrapper as %%TRANSPORT%% (Step 4). This honours
way_to_get_transport_request (DEFAULT / ASK / CREATE_NEW). If
/sap-transport-request reports ERROR, stop and surface it.
If PACKAGE is empty (Local Object / $TMP), skip this step and leave
%%TRANSPORT%% empty — the VBS registers the generated objects as $TMP.
The VBS runtime fails closed: if SAP prompts for a transport but %%TRANSPORT%%
is empty, it emits ABORT_EMPTY_TR and exits 1 (it does not silently press
Local Object).
This skill requires an active SAP GUI session. If not already logged in, use the /sap-login skill first, then return here.
The check VBScript template is at ./references/sap_se54_check.vbs.
Write {RUN_TEMP}\sap_se54_check_run.ps1:
$content = [System.IO.File]::ReadAllText('<SKILL_DIR>\references\sap_se54_check.vbs', [System.Text.Encoding]::UTF8)
$content = $content -replace '%%TABLE_NAME%%','THE_TABLE_NAME'
# Phase 4.2 session-attach plumbing. BAKE the resolved 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 (2026-08-06).
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'
$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_se54_check_run.vbs', $content, [System.Text.UnicodeEncoding]::new($false, $true))
Write-Host ("Done (session_path='" + $sessionPath + "')")
Replace THE_TABLE_NAME with the actual table name (UPPERCASE) and <SKILL_DIR> with the absolute path to this skill directory.
Run:
powershell -ExecutionPolicy Bypass -File "{RUN_TEMP}\sap_se54_check_run.ps1"
Declare the GUI target in the SAME block as cscript — the attach lib reads
SAPDEV_EXPECT_SYSTEM/_CLIENT from the process environment, so a GUI parked on
a different system than the RFC leg is refused instead of driven:
. '<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_se54_check_run.vbs'
Parse the last line of output:
EXIST → maintenance dialog already exists → tell the user and stop. No generation needed.NOT_EXIST → no maintenance dialog → proceed to Step 4 (Generate).ERROR: → show full output and stop.The generate VBScript template is at ./references/sap_se54_generate.vbs.
Write {RUN_TEMP}\sap_se54_generate_run.ps1:
$content = [System.IO.File]::ReadAllText('<SKILL_DIR>\references\sap_se54_generate.vbs', [System.Text.Encoding]::UTF8)
$content = $content -replace '%%TABLE_NAME%%','THE_TABLE_NAME'
$content = $content -replace '%%AUTH_GROUP%%','THE_AUTH_GROUP'
$content = $content -replace '%%FUNC_GROUP%%','THE_FUNC_GROUP'
$content = $content -replace '%%MAINT_TYPE%%','THE_MAINT_TYPE'
$content = $content -replace '%%OVERVIEW_SCREEN%%','THE_OVERVIEW_SCREEN'
$content = $content -replace '%%DETAIL_SCREEN%%','THE_DETAIL_SCREEN' # required only when MAINT_TYPE=2
$content = $content -replace '%%PACKAGE%%','THE_PACKAGE' # empty = Local Object ($TMP)
$content = $content -replace '%%TRANSPORT%%','THE_TRANSPORT' # RESOLVED_TR from Step 1b; empty for $TMP
# Phase 3.5 session-attach plumbing. The generate VBS also derives the shared
# post-action popup walker (sap_delete_popups.vbs) from %%ATTACH_LIB_VBS%%
# (same dir), so no extra token is needed for it.
# BAKE the session path (attach Strategy 1) -- an env var exported by this
# generator process never reaches the separate process that runs cscript.
. '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'
$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_se54_generate_run.vbs', $content, [System.Text.UnicodeEncoding]::new($false, $true))
Write-Host ("Done (session_path='" + $sessionPath + "')")
Replace all THE_* placeholders and <SKILL_DIR>. THE_TRANSPORT is
RESOLVED_TR from Step 1b (empty string for a $TMP / Local Object generation);
THE_DETAIL_SCREEN is required only when THE_MAINT_TYPE is 2.
Run:
powershell -ExecutionPolicy Bypass -File "{RUN_TEMP}\sap_se54_generate_run.ps1"
Declare the GUI target in the SAME block as cscript (see Step 4) so the maintenance dialog is generated on the system the RFC leg resolved:
. '<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_se54_generate_run.vbs'
Proceed to Step 5 to evaluate the result.
On success (output contains SUCCESS:):
On abort (output contains ABORT_EMPTY_TR):
/sap-transport-request (Step 1b) and re-run, or pass an
empty PACKAGE to keep the generated objects local ($TMP). The VBS did
not silently register the objects in $TMP.On failure (output contains ERROR:):
| Error message | Cause | Fix |
|---|---|---|
Not on Generation Environment screen | SE54 navigation failed | Check table name is valid |
MAINT_TYPE=2 ... requires a Single/detail screen number | Two-step maintenance requested without a detail screen | Provide the Single/detail screen number (Step 1) |
Unexpected popup at wnd[1] | Unhandled SAP dialog (not a Yes/No confirm) | Use Scripting Recorder to identify popup |
Generation failed [E] / [A] | SAP rejected the generation | Check status bar message for details |
Function group XXX does not exist | FG not created yet | Create function group first (SE37 or SE80) |
Table/View XXX does not exist | Invalid table name | Check table exists in SE11 |
All popup and screen-identity decisions in both VBS files are made by DDIC
control id + sbar.MessageType; window titles are never used for control flow
(they were English-only and broke under ZH/JA logons).
Delete all temporary files:
cmd /c del {RUN_TEMP}\sap_se54_check_run.vbs & del {RUN_TEMP}\sap_se54_check_run.ps1 & del {RUN_TEMP}\sap_se54_generate_run.vbs & del {RUN_TEMP}\sap_se54_generate_run.ps1
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_se54_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_se54_run.json" -Status FAILED -ExitCode 1 -ErrorClass <CLASS> -ErrorMsg "<short>"
Suggested <CLASS>: SE54_FAILED, TR_RESOLUTION_FAILED, GUI_TIMEOUT.
The generated .vbs files may contain sensitive data — delete after use (Step 6).
When filling VBS templates, always write with -Encoding Unicode (UTF-16 LE) in PowerShell.
UTF-16 LE is what cscript supports natively and preserves non-ASCII characters.
UTF-8 with BOM causes a cscript compile error.
| Element | Component ID | Type | Notes |
|---|---|---|---|
| Table/View field | txtVIMDYNFLDS-VIEWNAME | GuiTextField | Enter table name |
| Generated Objects radio | radVIMDYNFLDS-ELEM_GEN | GuiRadioButton | Select this |
| Create/Change button | btnVIMDYNFLDS-PUSH_GMNT | GuiButton | Press to proceed |
| Display button | btnVIMDYNFLDS-PUSH_SHOW | GuiButton | |
| Delete button | btnVIMDYNFLDS-PUSH_DELE | GuiButton | |
| ABAP Dictionary radio | radVIMDYNFLDS-STRUCT_MNT | GuiRadioButton | |
| Auth Groups radio | radVIMDYNFLDS-AUTH_MNT | GuiRadioButton | |
| Events radio | radVIMDYNFLDS-EVNTS | GuiRadioButton |
Appears when no maintenance dialog exists for the table.
| Element | Component ID | Notes |
|---|---|---|
| Yes button | wnd[1]/usr/btnSPOP-OPTION1 | Press to proceed to generation |
| No button | wnd[1]/usr/btnSPOP-OPTION2 | |
| Cancel button | wnd[1]/usr/btnSPOP-OPTION_CAN |
| Element | Component ID | Type | Notes |
|---|---|---|---|
| Authorization Group | ctxtTDDAT-CCLASS | GuiCTextField | Required |
| Function Group | ctxtTVDIR-AREA | GuiCTextField | Required |
| Package | ctxtTVDIR-DEVCLASS | GuiCTextField | Auto-filled |
| One step radio | radVIMDYNFLDS-MTYPE1 | GuiRadioButton | |
| Two step radio | radVIMDYNFLDS-MTYPE2 | GuiRadioButton | |
| Overview screen | txtTVDIR-LISTE | GuiTextField | e.g. 0010 |
| Single Screen | txtTVDIR-DETAIL | GuiTextField | For two step only |
| Standard recording | radVIMDYNFLDS-CORR_CON_S | GuiRadioButton | |
| Create (F6) | tbar[1]/btn[6] | GuiButton | Triggers generation |
Appears for each generated object (FUGR, TOBJ).
| Element | Component ID | Notes |
|---|---|---|
| Object name | wnd[1]/usr/txtKO007-L_OBJ_NAME | Read-only |
| Package | wnd[1]/usr/ctxtKO007-L_DEVCLASS | Default $TMP |
| Save button | wnd[1]/tbar[0]/btn[0] | Press to save |
If component IDs fail on the user's system:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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