sap-activate-object
Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for…
Generates a CORRECT inbound IDoc processing function module from two machine-readable inputs — the IDoc type's segment metadata (IDOCTYPE_READ_COMPLETE) and a field-mapping spec — plus a golden template that encodes the trap-rich protocol once: the fixed
Claude Code
$ npx -y skills add sapdev-ai/sap-dev --skill sap-gen-idoc-handler --agent claude-code
Codex
$ npx skills add sapdev-ai/sap-dev --skill sap-gen-idoc-handler -a codex -y
Cursor
$ npx skills add sapdev-ai/sap-dev --skill sap-gen-idoc-handler -a cursor -y
Gemini CLI
$ npx skills add sapdev-ai/sap-dev --skill sap-gen-idoc-handler -a gemini-cli -y
GitHub Copilot
$ npx skills add sapdev-ai/sap-dev --skill sap-gen-idoc-handler -a github-copilot -y
OpenCode
$ npx skills add sapdev-ai/sap-dev --skill sap-gen-idoc-handler -a opencode -y
Windsurf
$ npx skills add sapdev-ai/sap-dev --skill sap-gen-idoc-handler -a windsurf -y
name: sap-gen-idoc-handler description: | Generates a CORRECT inbound IDoc processing function module from two machine-readable inputs — the IDoc type's segment metadata (IDOCTYPE_READ_COMPLETE) and a field-mapping spec — plus a golden template that encodes the trap-rich protocol once: the fixed EDIDC/EDIDD/BDIDOCSTAT/BDWFRETVAR signature WE57 demands, the per-DOCNUM packet loop (the classic mass-processing junior trap), typed segment decode, the 53(ok)/51(error) status-record-per-IDoc protocol, RETURN_VARIABLES, and BAL application-log hooks — with a seeded ABAP Unit test that proves status 53 on the happy path BEFORE anything is wired. generate is read-only through generation (metadata read + offline template fill + offline /sap-check-abap) then a Rule-2-gated deploy delegated to /sap-function-group + /sap-se37 + /sap-se38, verified by /sap-run-abap-unit; the WE57/BD51/WE42/WE20 wiring is emitted as numbered operator instructions (NEVER auto-written — those are SAP-standard config tables). verify-wiring is a read-only RFC check of EDIFCT/TBD51/TEDE2/EDP21 that reports PRESENT/MISSING/COULD_NOT_CHECK per expected row + a WIRED/PARTIAL/UNWIRED verdict. One golden template serves ECC 6 and S/4 (release ABAP level from the customer brief). No new Z helper objects (the generated FM is the deliverable). Prerequisites: pinned RFC profile via /sap-login; NCo 3.1 (32-bit); a GUI session only for deploy. argument-hint: "generate <mapping.tsv> --idoctype <BASICTYPE> [--message-type <MESTYP>] [--fm-name Z_IDOC_INPUT_X] [--fugr FG] [--bapi BAPI] [--deploy ask|yes|no] | verify-wiring <FM> --idoctype <BT> --message-type <MT> [--process-code PC] [--partner P --partner-type LS|KU|LI]"
You generate a correct inbound IDoc handler FM (+ seeded ABAP Unit test) from IDoc-type metadata and a mapping spec, deploy it behind a confirm gate through the workbench skills, and check its WE57/BD51/WE42 wiring — read-only until the gated deploy, and never auto-writing the SAP-standard config tables.
Task: $ARGUMENTS
The metadata read + wiring check are scripts; **you** fill the golden template (`references/ idoc_inbound_handler_template.abap`) + test template from the segment tree and mapping spec.
---
| File | Token / call | Purpose | |---|---|---| | `<SKILL_DIR>/references/sap_idoc_type_read.ps1` | `-IdocType <BT>` | Segment-tree metadata (IDOCTYPE_READ_COMPLETE) | | `<SKILL_DIR>/references/sap_idoc_wiring_check.ps1` | `-FmName ...` | verify-wiring RFC read (EDIFCT/TBD51/TEDE2/EDP21) | | `<SKILL_DIR>/references/idoc_inbound_handler_template.abap` | template | Golden handler (fixed signature + protocol) | | `<SKILL_DIR>/references/idoc_inbound_test_template.abap` | template | Seeded ABAP Unit test | | `<SKILL_DIR>/references/idoc_mapping_template.tsv` | template | Mapping-spec input shape | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_rfc_lookup_struct.ps1` · `sap_rfc_lookup_fm.ps1` | shared | segment struct + BAPI signature | | `/sap-check-abap` · `/sap-function-group` · `/sap-se37` · `/sap-se38` · `/sap-run-abap-unit` | sub-skills | gate + gated deploy + test |
---
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))"powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_gen_idoc_handler_run.json" -Skill sap-gen-idoc-handler -ParamsJson "{}"Modes: `generate` | `verify-wiring`. Validate FM/report names via `sap_check_object_name.ps1`. Load the mapping spec; unknown `rule` token or missing `target` -> `IDOC_MAPPING_INVALID` (fail loud).
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_idoc_wiring_check.ps1" -FmName <FM> -IdocType <BT> -MessageType <MT> [-ProcessCode <PC>] [-Partner <P> -PartnerType <LS|KU|LI>] -SharedDir "<SAP_DEV_CORE_SHARED_DIR>"
Render the `WIRING:` lines + `VERDICT:` (WIRED / PARTIAL / UNWIRED / COULD_NOT_CHECK). A read that errors is COULD_NOT_CHECK, never a false PRESENT. Done.
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_idoc_type_read.ps1" -IdocType <BT> [-CimType <EXT>] -OutFile "{RUN_TEMP}\<name>_idoc_segments.tsv" -SharedDir "<SAP_DEV_CORE_SHARED_DIR>"`IDOC_TYPE_NOT_FOUND` -> abort. Cross-check every mapping-spec segment against the tree — a spec segment not in the tree is a HARD error naming the segment (never silently generate a bad decode).
`sap_rfc_lookup_struct.ps1` on each mapped SEGMENTTYP (they are plain DDIC structures) + `sap_rfc_lookup_fm.ps1` on `--bapi`; `sap_error_hints.ps1 -Action resolve` for trap hints (frequently_errors loop).
Fill `idoc_inbound_handler_template.abap` -> `<name>_handler.abap` (per-mapping `WHEN '<SEG>'` decode blocks, the BAPI call from the mapped fields, MSG_CLASS from the customer brief; release ABAP level per the brief for an ECC target) and `idoc_inbound_test_template.abap` -> `<name>_test.abap` (canned EDIDD from `sample_value`). Write `<name>_wiring_instructions.md` (numbered WE57/BD51/WE42/WE20 steps).
`/sap-check-abap` on both sources; loop fixes until clean.
`--deploy no`/silence -> SKIPPED (sources stay local). `yes` (or an explicit confirm to the `ask` prompt listing FM / FG / test report / target system) -> `/sap-function-group` (e
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.