Skip to content
Development
Skill

/sap-gen-idoc-handler

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

From plugin
sap-dev
10123 skills3 agents

Claude Code

$ npx -y skills add sapdev-ai/sap-dev --skill sap-gen-idoc-handler --agent claude-code

SKILL.md

sap-gen-idoc-handler.SKILL.md
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]"

SAP Generate IDoc Handler Skill

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.

---

Shared Resources

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

---

Step 0 — Resolve Work Directory

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

Step 0.5 — Start Logging

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

Step 1 — Parse Arguments + Validate Spec

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

Step 2 — verify-wiring (read-only)

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.

Step 3 — generate: metadata

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

Step 4 — Resolve structures + BAPI signature

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

Step 5 — Generate (offline, you)

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

Step 6 — Offline gate

`/sap-check-abap` on both sources; loop fixes until clean.

Step 7 — Deploy (Rule-2 confirm gate)

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

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-gen-idoc-handler.

Which coding agents can use sap-gen-idoc-handler?
sap-gen-idoc-handler 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.