/sap-gen-code:sap-gen-rap generate <STEM> --table <ZTABLE> [--package <PKG>] | package <work_folder> | verify <work_folder | --stem <STEM>>from sap-gen-code
Generates a complete managed-RAP business object file set from a base table for S/4 on-prem systems without ADT, packages it for abapGit import, and verifies artifacts via RFC.
Ships in sap-gen-code. 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.
Writing a consistent RAP file set by hand — interface CDS + projection + a BDEF pair
Task: $ARGUMENTS
S/4-only. RAP does not exist on ECC. Step 1.2 refuses a system below SAP_BASIS
7.54 or with no R3TR BDEF rows (RAP_RELEASE_UNSUPPORTED), pointing to /sap-gen-abap
| File | Token / call | Purpose |
|---|---|---|
<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md | (rule) | Mandatory operating rules |
<SAP_DEV_CORE_SHARED_DIR>/tables/sap_object_naming_rules.tsv | (read) | RAP_INTERFACE_VIEW / RAP_PROJECTION_VIEW / RAP_BEHAVIOR_CLASS / RAP_SERVICE_DEFINITION / RAP_SERVICE_BINDING rows |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_check_object_name.ps1 | (invoke) | Naming validator (Step 1.5) |
<SKILL_DIR>/references/sap_gen_rap_generate.ps1 | -Table -Stem -Release -OutDir | Render the RAP file set (DDIF_FIELDINFO_GET + templates) |
<SKILL_DIR>/references/sap_gen_rap_package.ps1 | -WorkDir -Stem | abapGit-layout zip |
<SKILL_DIR>/references/sap_gen_rap_verify.ps1 | -Ddls -Bdef -Clas -Srvd -Srvb | RFC verification (read-only) |
<SKILL_DIR>/references/templates/*.tpl | (render) | 7 templates (root 754/755, projection, 2 BDEF, behavior pool, SRVD, manual steps) |
../sap-gen-cds/references/sap_cds_release_probe.ps1 | (invoke) | CVERS SAP_BASIS for the Step 1.2 release gate |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_artifact_lib.ps1 / sap_finding_lib.ps1 | %%ARTIFACT_LIB_PS1%% %%FINDING_LIB_PS1%% | Register outputs + verdict |
Ships no GUI VBS. The RFC legs (generate DDIC lookup, verify) connect to the pinned profile.
<SAP_DEV_CORE_SHARED_DIR>is 3 levels up from<SKILL_DIR>thensap-dev-core\shared(cross-plugin).
Resolve work_dir/{RUN_TEMP}/{custom_url} (house one-liner — sap_connection_lib.ps1 is
dot-sourced there — with Write-Output ('RUN_TEMP=' + (Get-SapRunTemp)) appended; {RUN_TEMP} =
the per-run scratch dir holding the log state file — mint it once here and reuse, re-minting
breaks the -Action end state-file lookup), then
sap_log_helper.ps1 -Action start (state {RUN_TEMP}\sap_gen_rap_run.json).
generate | package | verify (implemented) | deploy (v1.5 — see Scope;
refuse with that note). Parse --table, --package (default $TMP), --stem.
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -File "<SKILL_DIR>\..\sap-gen-cds\references\sap_cds_release_probe.ps1" -SharedScripts "<SAP_DEV_CORE_SHARED_DIR>\scripts"
Parse SAP_BASIS=<n>. < 754 → STOP RAP_RELEASE_UNSUPPORTED (RAP infrastructure
absent; use /sap-gen-abap + /sap-gen-cds). 754 → the classic root-view dialect
(-Release 754); >= 755 → view-entity dialect (-Release 755). Capability
cross-check: verify reading TADIR R3TR BDEF returning zero on the whole system also
means no RAP → same refusal. (Verified: S4D 1909 = 754, has BDEF rows.)
Validate all five names via sap_check_object_name.ps1 (RAP_INTERFACE_VIEW ZI_<stem>,
RAP_PROJECTION_VIEW ZC_<stem>, RAP_BEHAVIOR_CLASS ZBP_<stem>,
RAP_SERVICE_DEFINITION ZUI_<stem>, RAP_SERVICE_BINDING ZUI_<stem>_O2). A violation →
ask proceed/abort (OBJECT_NAMING_VIOLATION).
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_gen_rap_generate.ps1" -Table <ZTABLE> -Stem <STEM> -Release <754|755> -OutDir "{work_dir}\rap\<stem>" -Package "<PKG>" -Label "<text>" -WorkDir "<work_dir>"
Reads the base table's fields + keys over RFC (DDIF_FIELDINFO_GET, skips MANDT),
renders the file set (RAPGEN: per artifact) + MANUAL_STEPS.md + srvb_spec.md.
Present the generated set to the user. The behavior pool is empty (managed CRUD
needs no handler); validations/determinations from a spec are a manual-paste follow-up
(v1.5). STATUS: ERROR on a table with no fields/keys.
powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_gen_rap_package.ps1" -WorkDir "{work_dir}\rap\<stem>" -Stem <STEM>
Builds <stem>_rap_abapgit.zip (abapGit /src/ PREFIX layout, object-named files +
.abapgit.xml + the class .clas.xml; SRVB spec + MANUAL_STEPS carried in). Import via
ZABAPGIT_STANDALONE (verified present on S4D), then activate in the dependency order
in MANUAL_STEPS.md.
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_gen_rap_verify.ps1" -Ddls "ZI_<stem>,ZC_<stem>" -Bdef "ZI_<stem>,ZC_<stem>" -Clas "ZBP_<stem>" -Srvd "ZUI_<stem>" -Srvb "ZUI_<stem>_O2" -WorkDir "<work_dir>"
RAPOBJ: per object (ACTIVE|PRESENT|INACTIVE|MISSING|COULD_NOT_CHECK) +
STATUS: COMPLETE|PARTIAL. BDEF activation and SRVB publish-state are always
COULD_NOT_CHECK (no BDEF/SRVB source table exists on 1909; TADIR presence is
verified, deep state is never falsely passed). Map to findings via sap_finding_lib.ps1
(tri-state; a MISSING/INACTIVE object holds the verdict at PARTIAL).
Register the file set (kind rap_fileset), the zip (rap_package), and the verify
report (rap_verify, coverage tri-state, verdict COMPLETE/PARTIAL) via
Register-SapArtifact. Echo the headline. Then sap_log_helper.ps1 -Action end
(SUCCESS / SKIPPED+RAP_RELEASE_UNSUPPORTED / FAILED+RFC_LOGON_FAILED).
generate (7 templates + live DDIC field/key
lookup + 7.54/7.55 dialect dispatch + 5-name validation), package (abapGit zip),
verify (RFC). Scope guard: managed, OData V2, root-only, non-draft. Verified
live 2026-07-11 on S/4HANA 1909 (S4D): generate rendered a consistent set from real
T001 (80 fields, MANDT skipped, BUKRS key) in both dialects; verify read a real
SAP-delivered RAP BO as COMPLETE (DDLS/CLAS/SRVD ACTIVE, BDEF/SRVB PRESENT +
COULD_NOT_CHECK) and an undeployed set as PARTIAL (all MISSING); package built a
valid abapGit /src/ tree. Offline golden-file tested (both dialects, MANDT skip,
key/non-key aliasing, no trailing comma, strict ( 2 ) only on 7.55).COULD_NOT_CHECK (no source table under any probed name on 1909) — never rendered
passed; a MISSING/INACTIVE object holds the verdict at PARTIAL. DDDDLSRC/SRVDSRC
SOURCE columns are RFC-forbidden (string columns → ASSIGN CASTING), so verify uses
TADIR + DWINACTIV, not source reads.deploy (v1.5, not implemented): the orchestrated partial deploy — root+projection
CDS via /sap-gen-cds --ddl-file (a small passthrough extension to gen-cds, its own
prerequisite), a confirm-gated PAUSE 1 to paste the two BDEFs in ADT (no RFC BDEF
create API on 1909), the behavior pool via /sap-se24, a PAUSE 2 for SRVD/SRVB +
/IWFND/MAINT_SERVICE publish, then a full re-verify. It is a confirm-gated write
path with two ADT-only manual steps, so it ships after the gen-cds extension + a live
run; until then the abapGit-import loop (generate → package → import → verify) is
the complete no-ADT path. New error class reserved: RAP_MANUAL_STEP_PENDING.--child (parent-child compositions), --draft (release-gated >= 2020;
1909 managed RAP has no draft), DDLX metadata, BDEF/SRVD/SRVB installer FMs (a
reverse-engineering project — real half-install risk). SRVB has no stable text
serialization → shipped as a spec (srvb_spec.md), created in ADT.README.md (opens in a new tab)references/fixtures/fields_zorder.tsv (opens in a new tab)references/sap_gen_rap_generate.ps1 (opens in a new tab)references/sap_gen_rap_package.ps1 (opens in a new tab)references/sap_gen_rap_verify.ps1 (opens in a new tab)references/templates/rap_bdef_managed.bdef.tpl (opens in a new tab)references/templates/rap_bdef_projection.bdef.tpl (opens in a new tab)references/templates/rap_behavior_pool.clas.abap.tpl (opens in a new tab)references/templates/rap_manual_steps.md.tpl (opens in a new tab)references/templates/rap_projection_view.ddl.tpl (opens in a new tab)references/templates/rap_root_view_754.ddl.tpl (opens in a new tab)references/templates/rap_root_view_755.ddl.tpl (opens in a new tab)references/templates/rap_srvd.srvd.tpl (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sap-rap, abapgit, business-object-generation, sap-s4hana, clean-core
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-gen-code12 skills in this plugin
/sap-docs-checkValidates an extracted design spec before ABAP code generation, across two
dimensions: `ddic` checks DDIC objects (domains / data elements / tables) —
naming, data-type validity, domain/DTEL/table cross-references, currency-ref
completeness, the primitive-as-data-element trap; `process` checks the
process-logic text for unclear/ambiguous steps, missing info, and logic /
type / cross-reference inconsistencies. Both optionally verify references
against the live system over RFC when a SAP logon is given. Runs BOTH by default
(whichever inputs exist); --dimension ddic|process forces one. Writes a
TAB-separated result file per dimension for Excel review. Replaces the former
/sap-docs-check-ddic and /sap-docs-check-process.
Input: work folder path; optional SAP Logon description enables the RFC checks.
/sap-docs-convertApplies customer-specific normalisation rules to the extracted spec files
in a work folder. Reads `spec_conversion_rules.tsv` (default at
sap-dev-core/shared/tables/, override at {custom_url}/spec_conversion_rules.tsv)
and rewrites the affected `_*.txt` files in place.
Three rule categories:
* field_rename — legacy field name → canonical name
* type_rename — legacy DDIC type token → canonical token
* flag_mapping — legacy flag value → one or more KEY=VALUE pairs
Plus optional schema migration (legacy customer YAML/TSV layout → Customer
Brief layout).
Input: work folder containing the extracted `_*.txt` files (output of /sap-docs-extract).
Output: same files rewritten in place; a `.pre-convert/` snapshot is taken first.
This skill is OPTIONAL — projects already authoring specs in Customer Brief
format can skip it entirely.
/sap-docs-estimateTurn the spec pipeline's structural signals into a transparent, falsifiable effort estimate
— no gut feel. `score` reads a spec work folder's `_*.txt` DDIC/process/interface counts and
`/sap-docs-check` ambiguity rows, applies published weights, and maps the complexity class to
a WIDE effort band with named drivers and an assumptions register. `--batch` rolls up a
portfolio of specs; `--ledger` bands a `/sap-cc-triage` migration wave by (tier x object
type). `record-actuals` appends real hours to an append-only ledger so every estimate becomes
measurable; `calibrate` (v1.5) tightens the multipliers once enough pairs accrue. Pure-local,
read-only, no SAP access in v1 (a `--live-delta` brownfield-credit RFC mode is v2). Every
report is labelled UNCALIBRATED so a wide band can never masquerade as a commitment.
/sap-docs-extractReads a SAP design document (Excel .xlsx, Word .docx, PDF) — or an existing work
folder / a _raw.txt file — and extracts structured information into separate text
files by type: program summary, domains, data elements, tables, error messages,
text elements, and process logic. From a document it creates a fresh work folder,
dumps {doc_name}_raw.txt, then structures; existing {doc_name}_*.txt files are
silently overwritten. Optionally chain /sap-docs-convert afterwards for
customer-specific normalisation, then /sap-docs-check and /sap-gen-abap. Legacy
binary .doc is not supported (save as .docx first); an unsupported format aborts
with "ERROR: Unsupported file format."
/sap-docs-layoutEdits the structural layout of a SAP design spec template (.xlsx) by writing
to the workbook's `(Meta) Layout` sheet. Lets customers customize sheet
names, column orders, and output mappings without editing Markdown rules or
skill code. The meta sheet becomes the per-workbook source of truth that
`/sap-docs-extract` reads on its next run.
Operations:
inspect Print the current layout in human-readable form.
bootstrap Copy a `(Meta) Layout` sheet from the canonical
`spec_template.xlsx` into a workbook that doesn't have one.
add-column Add a column to a section. Updates xlsx + meta in one step.
rename-sheet Rename a sheet and update meta so the parser still finds it.
validate Reconcile the meta sheet against actual workbook structure.
Input: workbook path + operation + op-specific args.
Output: in-place modifications to the .xlsx file. A timestamped backup is
written next to the original before any write operation.
/sap-gen-abapGenerates ABAP source code from a process text file ({doc_name}_process.txt)
produced by sap-docs-extract. Supports generating:
- Dialog/Module Pool programs
- ABAP Reports (帳票/バッチ)
- Function Modules / RFC
Uses variable naming conventions from sap-dev-core/shared/tables/abap_naming_rules.tsv (or custom override from {custom_url}).
Prerequisites: Run /sap-docs-convert and /sap-docs-extract first.