sap-activate-object
Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for…
Fixes ABAP source code issues found by sap-check-abap (all dimensions). Reads the check result file(s), builds a fix plan, and applies fixes: - NAMING violations: renames variables throughout the file - UNUSED variables: comments out declarations - SYNTAX-SAFE rewrites
Claude Code
$ npx -y skills add sapdev-ai/sap-dev --skill sap-fix-abap --agent claude-code
Codex
$ npx skills add sapdev-ai/sap-dev --skill sap-fix-abap -a codex -y
Cursor
$ npx skills add sapdev-ai/sap-dev --skill sap-fix-abap -a cursor -y
Gemini CLI
$ npx skills add sapdev-ai/sap-dev --skill sap-fix-abap -a gemini-cli -y
GitHub Copilot
$ npx skills add sapdev-ai/sap-dev --skill sap-fix-abap -a github-copilot -y
OpenCode
$ npx skills add sapdev-ai/sap-dev --skill sap-fix-abap -a opencode -y
Windsurf
$ npx skills add sapdev-ai/sap-dev --skill sap-fix-abap -a windsurf -y
name: sap-fix-abap
description: |
Fixes ABAP source code issues found by sap-check-abap (all dimensions).
Reads the check result file(s), builds a fix plan, and applies fixes:
- NAMING violations: renames variables throughout the file
- UNUSED variables: comments out declarations
- SYNTAX-SAFE rewrites (SQL_STRICT_COMMA / line-length / DECL_ORDER)
- CALL FUNCTION param fixes (UNKNOWN_PARAM rename / MISSING_MANDATORY stub /
WRONG_SECTION move) from the `fm` dimension — absorbed from the former sap-fix-fm
- SYNTAX errors: a bounded AI-assisted check->patch->re-check loop that drives the
headless `sap_rfc_syntax_check.ps1` engine (no blind auto-fix)
- TYPE_NOT_FOUND and other semantic codes: flagged for manual review
Creates a timestamped backup (.bak) before modifying the source file.
Prerequisites: Run sap-check-abap first to produce the result file(s). The `fm`
and `syntax` fix paths need SAP NCo 3.1 (32-bit) + the dev-init wrapper.
argument-hint: "<path-to-abap-source-file> [<path-to-check-result-tsv>] [--syntax-loop]"You fix ABAP source code quality issues detected by sap-check-abap. You rename variables that violate naming conventions, comment out unused declarations, and flag type issues for manual review. You always back up the file before making changes.
Task: $ARGUMENTS
---
| 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 — offline fixer, but rule applies to downstream deploy skills the fixed source feeds | | `<SAP_DEV_CORE_SHARED_DIR>/rules/abap_code_quality_rules.md` | ABAP code-quality rules — fixes applied here (variable renames, unused-comment-out) must preserve / restore modern-ABAP conventions; never introduce literal MESSAGE strings or downgrade syntax to obsolete forms while fixing |
---
**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 `<SAP_DEV_CORE_SHARED_DIR>/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 cross-plugin paths: 3 levels up from `<SKILL_DIR>`, then into `sap-dev-core\settings.json` and (if present) `sap-dev-core\settings.local.json`. Set `{WORK_TEMP}` = `{work_dir}\temp` and ensure it 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 `_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_fix_abap_run.json`. Best-effort.
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_fix_abap_run.json" -Skill sap-fix-abap -ParamsJson "{\"abap_file\":\"<ABAP_FILE>\",\"result_tsv\":\"<TSV>\"}"---
Extract from `$ARGUMENTS`:
Also look for the sibling result files the other `sap-check-abap` dimensions write (fix whichever are present):
Verify both files exist:
powershell -Command "if (Test-Path 'ABAP_FILE') { 'OK' } else { 'NOT FOUND' }"
powershell -Command "if (Test-Path 'RESULT_FILE') { 'OK' } else { 'NOT FOUND' }"If either file does not exist, tell the user and stop.
---
Read the result TSV file. The file begins with a header section:
STATUS: SUCCESS_WITH_ISSUES: N declaration(s), M issue(s). ABAP_FILE <path> NAMING_RULES <path> TIMESTAMP <datetime> TOTAL_DECLARATIONS N TOTAL_ISSUES M
Followed by a blank line, column headers, and tab-delimited finding rows:
CHECK_TYPE SEVERITY LINE VARIABLE SCOPE DATA_KIND DETAIL FIX_ADVICE
Parse all findings into a list. Classify each by fixability. The table covers EVERY code `/sap-check-abap` can emit (VBS engine, Step 1.5 object naming, and the Step 3.5 / 3.6 / 3.7 sidecar validators). **Auto** is reserved for transforms that cannot change runtime semantics; any code whose fix could — even when a mechanical rewrite looks tempting — is **Manual** with guidance.
| CHECK_TYPE | Fixable? | Action | |---|---|---| | `NAMING` | Auto | Rename variable throughout file (case-insensitive, word-boundary aware) | | `UNUSED` | Auto | Comment out declaration line (skip chain declarations) | | `SQL_STRICT_COMMA` | Auto | Insert the missing commas between SELECT-list fields (`SELECT a b c` → `SELECT a, b, c`) — pure syntax; SAP rejects the statement without them (§9) | | `LINE_TOO_LONG` / `LINE_HARD_LIMIT` | Auto | Wrap the statement at a token boundary onto a continuation line. **Manual** when the over
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.
Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for…
Natural-language SAP API discovery over RFC (no GUI): turn a goal like "create a sales order" or "post a goods movement" into a…
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),…
Executes BDC (Batch Data Communication) sessions in SAP via RFC. Reads SHDB recording files from the bdc/ folder, connects via…
Changes the package (TADIR-DEVCLASS) assignment of an SAP repository object via the "Object Directory Entry" dialog (Goto >…
Validates ABAP source (report / program / FM / class / include) before deployment — one skill, dimension-dispatched: naming…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.