Skip to content
Development
Skill

/sap-idoc

Diagnoses and reprocesses failing IDocs — the #1 AMS interface incident class — read-only over RFC (no GUI). `find` runs a bounded EDIDC search (status / message type / partner / date window / docnum), resolves status texts (TEDS2) and severity, and counts failures per

From plugin
sap-dev
8123 skills3 agents
Install
$ npx -y skills add sapdev-ai/sap-dev --skill sap-idoc --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/sap-idoc

Context preview

The summary Claude sees to decide when to auto-load this skill.

Diagnoses and reprocesses failing IDocs — the #1 AMS interface incident class — read-only over RFC (no GUI). `find` runs a bounded EDIDC search (status / message type / partner / date window / docnum), resolves status texts (TEDS2) and severity, and counts failures per

SKILL.md

sap-idoc.SKILL.md
name: sap-idoc
description: |
  Diagnoses and reprocesses failing IDocs — the #1 AMS interface incident class —
  read-only over RFC (no GUI). `find` runs a bounded EDIDC search (status /
  message type / partner / date window / docnum), resolves status texts (TEDS2)
  and severity, and counts failures per status+message type. `explain <DOCNUM>`
  gives the full EDIDS status history for one IDoc — each step with its severity,
  message id, parameters and rendered text — plus an SLG1 cross-reference, so the
  root cause (e.g. "posting period not open", "sold-to party not maintained") is
  read straight off the log. `triage` clusters status-51/56 failures by root cause
  and hands custom-handler clusters to /sap-fix-incident. `reprocess` status-routes
  a DOCNUM / cluster / selection to RBDMANI2 / RBDAPP01 / RSEOUT00 via /sap-run-report
  (confirm-gated) then re-reads EDIDS to verify. Prerequisites: SAP profile via
  /sap-login (RFC); SAP NCo 3.1 (32-bit). No GUI session, no Z-object dependency
  for find/explain/triage.
argument-hint: "find [--dir=1|2] [--status=51,56] [--mestyp=M] [--partner=P] [--from=YYYYMMDD] [--to=YYYYMMDD] [--max=N] | explain <DOCNUM> | triage [find-filters] | reprocess <DOCNUM|--status=..&--mestyp=..>"

SAP IDoc Diagnosis + Reprocess

You diagnose failing IDocs in bulk and reprocess them behind a confirm gate, read-only over RFC. The work is triage: decode hundreds of status-51/56 IDocs, cluster them by actual root cause, and reprocess a whole cluster with one gate.

Task: $ARGUMENTS

**You are read-only for `find` / `explain` / `triage`.** The only state change is `reprocess`, which executes an SAP-standard reprocess report through /sap-run-report behind an evidence-first confirm gate.

---

Shared Resources

| File | Token / call | Purpose | |---|---|---| | `<SAP_DEV_CORE_SHARED_DIR>/rules/safety_policy.md` | *(rule)* | **Rule 0 (highest priority)** — environment guard; enforced by Step 4 via `sap_safety_gate.ps1` | | `<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md` | *(rule)* | Mandatory operating rules — reads always allowed; reprocess is a SAP-supplied report, gated | | `<SKILL_DIR>/references/sap_idoc_read.ps1` | `-Action find\|explain [filters\|-Docnum]` | EDIDC find + EDIDS explain (RFC) | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_rfc_lib.ps1` / `sap_object_resolver.ps1` / `sap_artifact_lib.ps1` | dot-sourced by the engine | RFC connect, `Read-SapTableRows`, artifact index | | `/sap-run-report` | sub-skill | Executes RBDMANI2 / RBDAPP01 / RSEOUT00 (`reprocess`) — owns the execution gate | | `/sap-diagnose` | related | Triages interface incidents via its `smq` (queues) reader (Wave-0 T1-B); this skill is the IDoc half — invoke directly or as a follow-up | | `/sap-fix-incident` | sub-skill | Handoff for clusters whose handler is custom (Z/Y) code |

---

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

Set `{RUN_TEMP}` via `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_idoc_run.json" -Skill sap-idoc -ParamsJson "{}"

---

Step 1 — Parse Arguments

| Mode | Args | Access | |---|---|---| | `find` | `[--dir=1\|2]` `[--status=..]` `[--mestyp=..]` `[--partner=..]` `[--from=..]` `[--to=..]` `[--max=500]` | **read-only** | | `explain` | `<DOCNUM>` | **read-only** | | `triage` | *find-filters* | **read-only** | | `reprocess` | `<DOCNUM>` or a bounded selection (`--status=` & `--mestyp=`/`--partner=`) | **gated write** |

`find`/`triage` require **at least one bound** (status / mestyp / partner / date / docnum) — the engine refuses an unbounded scan (`IDOC_SELECTION_UNBOUNDED`). `test send` / `config-check` / `pointers` and segment-level SDATA **decode** are **not implemented in v1** (see Scope). If asked, say so and continue.

---

Step 2 — Ensure the RFC Profile

RFC connection only — no GUI. A profile must be pinned (`/sap-login`). RFC unavailable → fail loud (`RFC_LOGON_FAILED`), manual pointer WE02/WE05; never a partial "no IDocs" answer.

---

Step 3 — `find` (read-only)

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_idoc_read.ps1" -Action find -Status "51,56" -SharedDir "<SAP_DEV_CORE_SHARED_DIR>" -OutTsv "{RUN_TEMP}\idoc_list.tsv"

Parse `IDOC:` rows + `COUNT:` digests + `STATUS: OK rows=<n|">Max"> capped=..`. Render the per-status × message-type counts first (the triage digest), then the list. `capped=Y` or `rows=">Max"` → tell the user it's "at least N — narrow the window or raise `--max`". `IDOC_SELECTION_UNBOUNDED` → ask for a bound and STOP.

Step 3b — `explain <DOCNUM>` (read-only)

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_idoc_read.ps1" -Action explain -Docnum "<DOCNUM>" -SharedDir "<SAP_DEV_CORE_SHARED_DIR>"

Parse `HEADER:` + ordered `STEP:` lines. The **last `sev=E` step** carries the root cause (`text=`). Present the dossier: header (message type, partners, current status) → status timeline → the error message(s). Then cross-reference SLG1 over the failure window via `/sap-diagnose --reader slg1` (standalone single-reader mode) for the application-log detail. `IDOC_NOT_FOUND` → report and STOP.

Step 3c — `triage` (read-only)

Run `find` with the given filters, then **cluster** the failures. Key each IDoc by `(MESTYP, STAMID, STAMNO)` — sample one `explain` per distinct message id to get the error text — and label each cluster with a root-cause hypothesis + count + the DOCNUM list. Write `{RUN_TEMP}\idoc_clusters.tsv`. A cluster whose `IDOCTP` is custom (`Z*`/`Y*`) gets a `/sap-fi

Read more
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.

Get the whole plugin

Other skills on sap-dev.