Skip to content
Development
Skill

/sap-output-diagnose

Root-causes classic NAST output determination — "the invoice didn't print / the PO IDoc never went out" — read-only over RFC (no GUI). `billing <VBELN>` and `po <EBELN>` walk the whole chain an expert checks by hand: NAST status → CMFP processing-log excerpt (rendered via

From plugin
sap-dev
8123 skills3 agents
Install
$ npx -y skills add sapdev-ai/sap-dev --skill sap-output-diagnose --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-output-diagnose

Context preview

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

Root-causes classic NAST output determination — "the invoice didn't print / the PO IDoc never went out" — read-only over RFC (no GUI). `billing <VBELN>` and `po <EBELN>` walk the whole chain an expert checks by hand: NAST status → CMFP processing-log excerpt (rendered via

SKILL.md

sap-output-diagnose.SKILL.md
name: sap-output-diagnose
description: |
  Root-causes classic NAST output determination — "the invoice didn't print / the
  PO IDoc never went out" — read-only over RFC (no GUI). `billing <VBELN>` and
  `po <EBELN>` walk the whole chain an expert checks by hand: NAST status →
  CMFP processing-log excerpt (rendered via BAPI_MESSAGE_GETDETAIL) → the output
  determination procedure (TVFK-KALSM / T683S) → each access of the access
  sequence (T685/T682I/T682Z) → the generated B* condition tables, rebuilding each
  access key FROM THE DOCUMENT and probing it. Emits a ranked verdict with the
  exact missing condition key (NO_RECORD), the failing requirement routine
  (RV61B<nnn>), or the processing-log error. `reissue` re-drives the output via
  RSNAST00 (confirm-gated, delegated to /sap-run-report) then re-reads NAST to
  verify. S/4 Output Management (BRF+) is disclosed when present. Prerequisites:
  SAP profile via /sap-login (RFC); SAP NCo 3.1 (32-bit). No GUI, no Z-object,
  no /sap-dev-init.
argument-hint: "billing <VBELN> | po <EBELN>  [--type <KSCHL>] [--json] [--out PATH]   |   reissue (billing|po) <DOCNO> <KSCHL>"

SAP Output (NAST) Determination Diagnosis

You root-cause **why an output did (or didn't) go out** for an SD billing document (KAPPL=V3) or MM purchase order (KAPPL=EF), read-only over RFC. This automates the 20+ SE16 lookups and condition-technique knowledge an output expert applies — NAST status, the CMFP processing log, the determination procedure, each access of the access sequence, and the generated B* condition tables — into one ranked verdict.

Task: $ARGUMENTS

**You are read-only against SAP for `billing` / `po`.** The only state change is `reissue`, which executes RSNAST00 through /sap-run-report behind a 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 7 via `sap_safety_gate.ps1` | | `<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md` | *(rule)* | Mandatory operating rules — reads always allowed; the one write (RSNAST00) is a SAP-supplied API, confirm-gated | | `<SKILL_DIR>/references/sap_output_nast_read.ps1` | `-App billing\|po -DocNo <n> [-Kschl -OutJson]` | Stages 1-3: doc resolve + NAST classify + CMFP log (RFC) | | `<SKILL_DIR>/references/sap_output_walk.ps1` | `-App billing\|po -DocNo <n> [-Kschl -OutJson -CustomUrl]` | Stages 4-8: procedure/access walk + B* probes + BRF+ (RFC) | | `<SKILL_DIR>/references/output_field_map.tsv` | read by the walk | Comm-field → header-source override (customer-extensible) | | `<SKILL_DIR>/references/output_verdicts.md` | maintainer doc | Verdict vocabulary + ranking | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_rfc_lib.ps1` / `sap_object_resolver.ps1` / `sap_artifact_lib.ps1` | dot-sourced by the engines | RFC connect, `Read-SapTableRows`, artifact index | | `/sap-run-report` | sub-skill | Executes RSNAST00 (`reissue`) — owns the execution confirm gate | | `/sap-job` | sub-skill | Checks the RSNAST00 periodic job (batch dispatch) | | `/sap-explain-object` | sub-skill | Explains a flagged requirement routine `RV61B<nnn>` |

---

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 ('CUSTOM_URL=' + (Get-SapSettingValue 'custom_url' ((Get-SapWorkDir) + '\custom')))"

Set `{RUN_TEMP}` via `Get-SapRunTemp` (per-run scratch).

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_output_diagnose_run.json" -Skill sap-output-diagnose -ParamsJson "{}"

---

Step 1 — Parse Arguments

| Mode | Args | Access | |---|---|---| | `billing` | `<VBELN>` `[--type <KSCHL>]` `[--json]` `[--out PATH]` | **read-only** | | `po` | `<EBELN>` `[--type <KSCHL>]` `[--json]` `[--out PATH]` | **read-only** | | `reissue` | `(billing\|po) <DOCNO> <KSCHL>` `[--medium <NACHA>]` | **gated write** (RSNAST00) |

`pricing <VBELN> [<POSNR>]` is **Phase 2 (not implemented)** — if asked, say so and stop. `--type` restricts the walk to one output type. Numeric doc numbers are zero-padded to 10 digits by the engines.

---

Step 2 — Ensure the RFC Profile

RFC connection only — no GUI session. A profile must be pinned (`/sap-login`); the engines self-connect. **RFC unavailable → fail loud** (`RFC_LOGON_FAILED`), never a partial verdict; suggest `/sap-doctor rfc`.

---

Step 3 — Read NAST Status + Processing Log (stages 1-3)

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_output_nast_read.ps1" -App <billing|po> -DocNo "<DOCNO>" -SharedDir "<SAP_DEV_CORE_SHARED_DIR>" -OutJson "{RUN_TEMP}\nast.json"

Parse:

DOC:  app=.. docno=.. exists=<Y|N> type=<FKART|BSART> org=..
NAST: kschl=.. medium=.. vstat=<0|1|2> status=<ISSUED_OK|PROCESSING_FAILED|NOT_YET_PROCESSED> cmfpnr=.. program=.. dispatch=<VSZTP>
LOG:  kschl=.. sev=<E|W|I> msg="<class-nr: rendered text>"
STATUS: OK n_outputs=.. failed=.. notyet=.. | OUTPUT_DOC_NOT_FOUND | RFC_ERROR

`OUTPUT_DOC_NOT_FOUND` (exit 1) → tell the user the document doesn't exist, log end `OUTPUT_DOC_NOT_FOUND`, STOP. Otherwise classify each NAST row:

  • **`PROCESSING_FAILED` (VSTAT=2)** — the headline. The `LOG:` line carries the

rendered root cause (e.g. *"EDI: Partner profile does not exist"*). Report it and, if custom code is implicated, offer `/sap-fix-incident`.

  • **`NOT_YET_PROCESSED` (VSTAT=0)** — determined but not dispatched. `dispatch`

(VSZTP) `1` = send via periodically scheduled job → delegate `/sap-job list --jobname=RSNAST00*` to confirm the job runs; `3`/`4` = send with app / explicit.

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.