SC4SAP Interface Mapping Specification
Interviews the consultant briefly and writes one editable HTML page per interface: cover, revision history, the mapping sheet (header, systems, Source → Target grid with R / MAPPING columns, response block for synchronous interfaces, conversion rules, extraction condition, remarks) and the field guide. The SAP side comes from the system; the other side is proposed and corrected in the page.
<Response_Prefix>Every response triggered by this skill MUST begin with [Model: <main-model> · Dispatched: <sub-summary>] per ../../common/model-routing-rule.md § Response Prefix Convention.</Response_Prefix>
<Target_Object>The target object is looked up on the active profile's system only. Not found → stop and ask per ../../common/multi-profile-artifact-resolution.md § Target object not on the active system — never substitute a similar name, never switch profiles on your own.</Target_Object>
<Phase_Banner>Before each Agent(...) dispatch, emit ▶ phase=<id> (<label>) · agent=<name> · model=<Opus|Sonnet|Haiku> per ../../common/model-routing-rule.md § Phase Banner Convention. Resolve the dispatch mode first per ../../common/model-dispatch-mode.md.</Phase_Banner>
<Team_Mode>No teamMode integration. Reading SAP, proposing and building are scripted; agents only propose fields (optional) and translate.</Team_Mode>
<Use_When>
- "인터페이스 매핑 정의서", "매핑 스펙", "interface mapping spec", "I/F 정의서", "EAI 매핑", "field mapping for interface "
- A new interface must be specified before development (the usual case)
- An existing RFC / proxy structure / Z table needs its mapping written down
- An edited page comes back (import), or the SAP structure changed (refresh) </Use_When>
<Do_Not_Use_When>
- Specification of a program →
/sc4sap:program-to-spec - Creating the Z structure / RFC itself →
/sc4sap:create-object(this skill hands it the field list, Step 8) - An interface catalogue across many interfaces — one interface per document </Do_Not_Use_When>
<Decisions_Fixed> Settled with the user when the skill was designed — do not ask again:
| Topic | Decision |
|---|---|
| Output | Editable HTML only (no .xlsx); one interface per document; one page with an optional response block (B01…) for synchronous interfaces |
| SAP side | Read from SAP (DDIC table / DB view / structure — a proxy by its structure —, CDS by SQL view name, function module signature). New interfaces: a TABLE-FIELD / data-element list, the module consultant's proposal (checked against DDIC), Excel paste in the page, or an empty grid |
| Carriers | The grid is split by ▸ group rows — the unit the fields travel in, per side: name, kind (PARAMETER / STRUCTURE / TABLE), occurrence (0:1 … 1:N). A row's Table column holds only the source DDIC table. The system block's Structure / occurrence is the read-only summary of the groups. FM: scalar parameters of one direction share one PARAMETER group; each structure / table parameter is its own group |
| Colours | Source side blue, target side green — header, system block and grid cells |
| SAP types | Shown as DB types of the code list (NUMC → NUMBER, DATS → DATE …); the DDIC type is the cell tooltip |
| Other side | Proposed (same names, DB types, MAPPING 1:1), marked "Proposal" until edited or confirmed |
| Conversion rules | Proposed from the SAP types (date, time, leading zeros / ALPHA, currency, quantity / unit) and linked in the R column |
| Checks | Empty required (*) items, MAPPING to a missing row, unknown R id, size truncation, type-family mismatch, unmapped target field, key mismatch — all in the page's Checks panel |
| Versions | v0.1 → +0.1 per saved / imported edit, per refresh with changes; the revision-history table fills itself (author, change, optional approver) |
| Language | Page language from .sc4sap/config.json (language, else ko); English companion always built unless the user opts out |
| Settings | <base>/interfaces/project.json: cover (project name, title, document-number pattern IF-MAP-{ifId}, copyright), idPattern for IF ID numbering, code-list overrides (codes) |
| File name | Page: <IF_ID>_<OBJECT>_<interface name>-v<ver>-<lang>.html (SAP object of the SAP side, else the object typed in the system block; empty parts left out). The model json stays <IF_ID>-v<ver>-<lang>.json |
| Location | <base>/interfaces/<IF_ID>/ — <base> per ../../common/multi-profile-artifact-resolution.md (.sc4sap/work/<alias>/ with an active profile) |
| Template content | Generic: never put customer, vendor or people names into the skill or into public docs; real names belong only in the user's project.json and documents |
| </Decisions_Fixed> |
Entry check. If the user hands back an edited page → Step 6. "Refresh / SAP changed" → Step 7. "Z structure / create the RFC" → Step 8. Otherwise a new document: Steps 1–5.
Step 1 — Preflight and project settings. Confirm the active profile in one line. If <base>/interfaces/project.json is missing, ask once (MUST read interview.md § Project) and Write it.
Step 2 — Interview. MUST read interview.md § Interface. One AskUserQuestion round (scenario preset, where the SAP fields come from, IF ID), then one short free-text ask for name, summary, systems and the SAP object or field list. Unanswered items stay empty — the page highlights them; do not chase every field in chat.
Step 3 — Field proposal (only when the user chose "describe the business"). Dispatch the module consultant with dispatch-prompts.md § 1. Show the returned TABLE-FIELD list with one reason each and ask the user to confirm or trim it in one message; the confirmed list becomes fields.
Step 4 — Build v0.1. Write the answers to <base>/interfaces/_answers/<IF_ID>.json (shape in interview.md § Answers), then <B> init --answers <file>. Report problems (fields SAP does not have, unreadable parameter types — for those offer --line PARAM=STRUCTURE and refresh).
Step 4a — Korean polish (page language ko). Per common/humanize-korean.md, <dir> = <base>/interfaces/<IF_ID>/_humanize: texts = node scripts/lib/humanize.mjs texts-json <base>/interfaces/<IF_ID>/<IF_ID>-v<ver>-ko.json --skip desc,ddic,dom --out <dir>/texts.json (latest version; desc / ddic are SAP's DDIC texts), apply = node scripts/lib/humanize.mjs apply-json <dir>/texts.json <dir>/humanized.json (or fixed.json), then <B> build --if <IF_ID>. Runs again after an import or refresh that adds prose.
Step 5 — English companion. Skip when the page language is en or the user opted out. <B> texts --if <ID> --to en → when todo > 0, dispatch sc4sap:sap-writer with dispatch-prompts.md § 2 to write outFile; then <B> companion --if <ID> --to en. missing must be empty.
Step 6 — Import an edited page. <B> import <file> → new version with the reader's revision row; hand-typed SAP fields (EKPO-MATNR, data elements) are filled from DDIC at the same time (resolved, problems). Refusals: version already imported; the page was edited from an older version (--force only when the user says to overwrite); an English companion page (edits go into the primary-language page, the companion is rebuilt from it); a page whose ID / version / language was changed outside edit mode. Then Step 5 again.
Step 7 — Refresh from SAP. <B> refresh --if <ID> [--line PARAM=STRUCTURE] → unchanged: true, or a new version with added / changed / removed fields marked in the grid and a revision row. Only SAP facts (type, length, DDIC type) are updated; key, null and descriptions the user wrote stay. --line values are remembered for later refreshes. Then Step 5 again.
Step 8 — Hand-off to create-object (on request, or offered once the user says the mapping is agreed). <B> fields --if <ID> lists the SAP-side fields with data elements; offer /sc4sap:create-object for a Z structure (proxy / RFC) built from that list. Never create SAP objects from this skill.
Close. Report in the user's language: page path(s), version, findings (errors / warnings / to confirm) with the first few error texts, problems, and the next steps: open the page → Edit → Save → hand the file back for import.
<MCP_Tools_Used>
Through the scripts only: GetTable, GetStructure, GetView, GetDataElement, GetTypeInfo, SearchObject, GetFunctionModule — DDIC metadata and source, never table contents.
</MCP_Tools_Used>
Task: $ARGUMENTS


