Skip to content
Development
Skill

/sap-fix-abap

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

From plugin
sap-dev
10123 skills3 agents

Claude Code

$ npx -y skills add sapdev-ai/sap-dev --skill sap-fix-abap --agent claude-code

SKILL.md

sap-fix-abap.SKILL.md
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]"

SAP Fix ABAP Skill

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

---

Shared Resources

| 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 |

---

Step 0 — Resolve Work Directory

**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`.

---

Step 0.5 — Start Logging

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>\"}"

---

Step 1 — Parse Arguments

Extract from `$ARGUMENTS`:

  • **ABAP source file path** — required. Ask if not provided.
  • **Check result TSV path** — optional; default is `<abap-file>.check.tsv`.

Also look for the sibling result files the other `sap-check-abap` dimensions write (fix whichever are present):

  • `<abap-file>.check_fm.tsv` — `fm`-dimension findings (CALL FUNCTION params) → Step 6b.
  • `<abap-file>.syntax.tsv` — `syntax`-dimension findings → the Step 8 syntax loop.

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.

---

Step 2 — Read and Parse the Result TSV

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

Read more
@sapdev-ai
Ships withsap-dev

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.

10123 skills3 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
10
Star history of sapdev-ai/sap-dev on GitHub, a chart by star-history.com

Other skills on sap-dev.

sap-activate-object

sap-activate-object

Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for…

@sapdev-ai@sapdev-aiInstall Skill
sap-api-advisor

sap-api-advisor

Natural-language SAP API discovery over RFC (no GUI): turn a goal like "create a sales order" or "post a goods movement" into a…

@sapdev-ai@sapdev-aiInstall Skill
sap-atc

sap-atc

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),…

@sapdev-ai@sapdev-aiInstall Skill
sap-call-bdc

sap-call-bdc

Executes BDC (Batch Data Communication) sessions in SAP via RFC. Reads SHDB recording files from the bdc/ folder, connects via…

@sapdev-ai@sapdev-aiInstall Skill
sap-change-package

sap-change-package

Changes the package (TADIR-DEVCLASS) assignment of an SAP repository object via the "Object Directory Entry" dialog (Goto >…

@sapdev-ai@sapdev-aiInstall Skill
sap-check-abap

sap-check-abap

Validates ABAP source (report / program / FM / class / include) before deployment — one skill, dimension-dispatched: naming…

@sapdev-ai@sapdev-aiInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about sap-fix-abap.

Which coding agents can use sap-fix-abap?
sap-fix-abap installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.