SC4SAP Create Object
Guided ABAP object creation workflow. Hybrid mode: confirms transport and package interactively, then auto-creates, writes initial code, and activates the object.
Invoke /sc4sap:trust-session with parent_skill=sc4sap:create-object to pre-grant all MCP tool + file-op permissions for this session (eliminates per-tool "Allow this tool?" prompts during Create* + activation flow).
- If
.sc4sap/session-trust.log already has a line within the last 24h, skip silently.
- Otherwise run it and surface the one-line confirmation.
Full spec: see ../trust-session/SKILL.md.
Priority: Standard DE (1) → existing CBO DE (2) → new CBO DE (3) → Data Type + Length (4, last resort). Raw primitives like LIFNR CHAR 10 / MATNR CHAR 40 / BUKRS CHAR 4 are forbidden when an authoritative SAP data element exists. Before each field, run SearchObject against DTEL and check .sc4sap/cbo/<MODULE>/<PACKAGE>/inventory.json.
FM signature is stored inline in the FUNCTION statement source (SAP parses it on write and updates TFDIR/FUPARAREF automatically). There is no separate "parameters" endpoint. Every FM source MUST declare IMPORTING / EXPORTING / CHANGING / TABLES / EXCEPTIONS clauses directly between FUNCTION {name} and the first .. Never emit the placeholder " You can use the template 'functionModuleParameter' ... line, never use *"*"Local Interface: blocks as a substitute, never declare shadow locals like lv_iv_xxx TYPE ... to stand in for missing parameters.
Remote-Enabled (RFC) flag is a separate concern — stored in TFDIR.FMODE, not in source. Currently requires manual SE37 Properties update; flag this in the completion report.
Auto-execute (after confirmation):
- Create object via appropriate MCP Create* tool
- Generate initial implementation (skeleton with proper structure)
- Activate the object
- Verify activation via
GetInactiveObjects
Per-step model allocation (skill main thread runs on Sonnet 4.6 per frontmatter; creation delegates to sap-executor; the report is rendered on main):
| Step |
Owner |
Model |
Role |
| 0 Trust |
skill-to-skill |
Sonnet |
permission bootstrap |
| 1 Classify |
main |
Sonnet |
keyword → object type |
| 2 Metadata |
main |
Sonnet |
name / package / transport / description (Q&A + SearchObject + ListTransports + naming validation) |
| 3 Pre-Creation Check |
main |
Sonnet |
SearchObject (name-exists guard) |
| 3.5 Version Branch |
main |
Sonnet |
SAP_VERSION ECC vs S/4 routing |
| 4 + 5 + 6 Create + Implement + Activate (standard flow) |
sap-executor with model: "opus" override |
Opus 4.7 |
One dispatch covers: CreateClass/CreateProgram/... → UpdateClass/UpdateProgram/... with initial implementation code → ActivateObjects → GetInactiveObjects verify. The Opus override is justified because Step 5 is novel code generation (common/model-routing-rule.md § Tier 2) — field typing priority 1–4, class constructor + method signatures, FM inline parameter declarations, etc. |
| 4-ECC DDIC Helper Program (ECC fallback) |
sap-executor with model: "opus" override |
Opus 4.7 |
ECC-only branch for Table/DTEL/DOMA. Executor picks the matching template from skills/create-object/ecc/, substitutes names, fills the field list per common/field-typing-rule.md, and CreateProgram + UpdateProgram + ActivateObjects the helper into $TMP. |
| 7 Completion Report |
main |
Sonnet |
Pure formatting from the executor's structured return — no agent dispatch. Localizes to the user's current conversation language. Render rules: dispatch-prompts.md § Step 7. For ECC fallback, use the mandatory report format there verbatim (do NOT rephrase the ⚠ header + 3-step SE38/SE11 checklist). |
At Step 2 (metadata collection) — when the object belongs to a specific SAP module (MM table, SD structure, PS data element, …) — the main thread reads SAP_ACTIVE_MODULES from sap.env / config.json and consults ../../common/active-modules.md. If companion modules are active, proactively suggest integration fields (e.g., creating an MM CBO table in a landscape with PS active → suggest adding PS_POSID / AUFNR). Do NOT add silently — propose to user and let them accept/decline, then pass the confirmed field list through to the executor dispatch.
The reference file covers:
- General rules (prefix, case, character set, length limits)
- Module codes (SD/MM/FI/CO/...) for the
Z{MODULE}_... pattern
- Object-specific patterns — Classes (ZCL_/ZIF_/ZCX_), Programs (ZR_), Function Groups/Modules, Data Dictionary (ZT_/ZDE_/ZDO_), UI (Dynpro/GUI Status), OData/RAP (Z_I_/Z_C_/Z_BP_/Z_SB_), Enhancements, IDoc/ALE
- Code-level naming (variables: LV_/LS_/LT_/IV_/EV_/MV_; constants GC_/LC_; types TY_; methods)
- Validation rules (uppercase, Z/Y prefix, character set, max length, non-generic)
Quick validation checklist (applied before every create):
- Starts with
Z or Y (customer namespace)
- UPPERCASE only, characters in
[A-Z0-9_]
- Within max length (30 chars for most objects)
- Not generic (ZTEST/ZTEMP/ZDUMMY forbidden)
- Object-type prefix follows the reference (e.g.,
ZCL_ for classes, ZIF_ for interfaces)
- Screen = 4-digit number (e.g., 0100); GUI Status = uppercase identifier (e.g., STATUS_0100) — both require a parent program
If the user-provided name violates any rule, suggest a compliant alternative based on configs/common/naming-conventions.md before proceeding.
Task: {{ARGUMENTS}}
1---2name: sc4sap-create-object3description: ABAP object creation workflow — confirm transport+package, auto-create and activate4---56# SC4SAP Create Object78Guided ABAP object creation workflow. Hybrid mode: confirms transport and package interactively, then auto-creates, writes initial code, and activates the object.91011<Purpose>12sc4sap:create-object handles the full lifecycle of creating a new ABAP object: determining the right object type, confirming package and transport assignment, creating the object via MCP, generating a well-structured initial implementation, and activating it — all in one workflow.13</Purpose>1415<Response_Prefix>16Every response triggered by this skill MUST begin with `[Model: <main-model> · Dispatched: <sub-summary>]` per [`../../common/model-routing-rule.md`](../../common/model-routing-rule.md) § Response Prefix Convention.17</Response_Prefix>1819<Phase_Banner>20Multi-phase skill. Before each `Agent(...)` dispatch, emit `▶ phase=<id> (<label>) · agent=<name> · model=<Opus 4.7|Sonnet 4.6|Haiku 4.5>` per [`../../common/model-routing-rule.md`](../../common/model-routing-rule.md) § Phase Banner Convention.21</Phase_Banner>2223<Use_When>24- User says "create", "new class", "new program", "create object", "add a function module", "new table", etc.25- A new ABAP development artifact needs to be created from scratch26- User knows what they want to build but needs the creation scaffolded correctly27</Use_When>2829<Do_Not_Use_When>30- Modifying an existing object -- use direct MCP `Update*` tools (`UpdateClass`, `UpdateProgram`, `UpdateInclude`, etc.)31- Creating multiple interdependent objects -- use `/sc4sap:create-program` for a full program with includes32- User just wants to understand what type to use -- ask a module consultant agent directly33</Do_Not_Use_When>3435<Session_Trust_Bootstrap>36**MANDATORY — runs as Step 0 before any MCP call or user interaction.**3738Invoke `/sc4sap:trust-session` with `parent_skill=sc4sap:create-object` to pre-grant all MCP tool + file-op permissions for this session (eliminates per-tool "Allow this tool?" prompts during Create* + activation flow).3940- If `.sc4sap/session-trust.log` already has a line within the last 24h, skip silently.41- Otherwise run it and surface the one-line confirmation.4243Full spec: see [`../trust-session/SKILL.md`](../trust-session/SKILL.md).44</Session_Trust_Bootstrap>4546<Supported_Object_Types>47| Type | MCP Create Tool | Description |48|------|----------------|-------------|49| Class | `CreateClass` | ABAP OO class (local or global) |50| Interface | `CreateInterface` | ABAP OO interface |51| Program | `CreateProgram` | Executable program (report) |52| Function Module | `CreateFunctionModule` + `CreateFunctionGroup` | RFC-capable function module |53| Table | `CreateTable` | Transparent database table |54| Structure | `CreateStructure` | ABAP structure (type definition) |55| Data Element | `CreateDataElement` | Domain-based data element |56| Domain | `CreateDomain` | Value domain with fixed values or ranges |57| CDS View | `CreateView` | Core Data Services view |58| Service Definition | `CreateServiceDefinition` | OData service definition |59| Service Binding | `CreateServiceBinding` | OData service binding (UI5/API) |60| Behavior Definition | `CreateBehaviorDefinition` | RAP behavior definition |61| Screen | `CreateScreen` | Dynpro screen (selection screen or dialog) |62| GUI Status | `CreateGuiStatus` | PF-Status (menu bar, toolbar, function keys) |63</Supported_Object_Types>6465<ECC_DDIC_Fallback>66**MANDATORY**: Read [`../../common/ecc-ddic-fallback.md`](../../common/ecc-ddic-fallback.md) before creating any Table / Data Element / Domain. It defines when the ECC branch triggers, the helper-program naming rules, the strict template format (mirroring the files under `ecc/`), and the hard constraints (`$TMP` only, no activate, no CTS).67</ECC_DDIC_Fallback>6869<Field_Typing_Rule>70**MANDATORY** for every Table / Structure / Table Type field-type decision (standard MCP flow **and** ECC helper-program fallback): read [`../../common/field-typing-rule.md`](../../common/field-typing-rule.md).7172Priority: **Standard DE (1)** → **existing CBO DE (2)** → **new CBO DE (3)** → **Data Type + Length (4, last resort)**. Raw primitives like `LIFNR CHAR 10` / `MATNR CHAR 40` / `BUKRS CHAR 4` are forbidden when an authoritative SAP data element exists. Before each field, run `SearchObject` against `DTEL` and check `.sc4sap/cbo/<MODULE>/<PACKAGE>/inventory.json`.73</Field_Typing_Rule>7475<Function_Module_Rule>76**MANDATORY** for every `UpdateFunctionModule` source emission: read [`../../common/function-module-rule.md`](../../common/function-module-rule.md).7778FM signature is stored inline in the `FUNCTION` statement source (SAP parses it on write and updates TFDIR/FUPARAREF automatically). There is no separate "parameters" endpoint. Every FM source MUST declare `IMPORTING / EXPORTING / CHANGING / TABLES / EXCEPTIONS` clauses directly between `FUNCTION {name}` and the first `.`. Never emit the placeholder `" You can use the template 'functionModuleParameter' ...` line, never use `*"*"Local Interface:` blocks as a substitute, never declare shadow locals like `lv_iv_xxx TYPE ...` to stand in for missing parameters.7980Remote-Enabled (RFC) flag is a separate concern — stored in TFDIR.FMODE, not in source. Currently requires manual SE37 Properties update; flag this in the completion report.81</Function_Module_Rule>8283<Hybrid_Mode>84**Confirm** (interactive):85- Object name (enforce Z/Y prefix, max 30 chars, uppercase)86- Package assignment (search with `GetPackage` if unsure)87- Transport number (list open transports via `ListTransports`, or create new)88- Short description8990**Auto-execute** (after confirmation):91- Create object via appropriate MCP Create* tool92- Generate initial implementation (skeleton with proper structure)93- Activate the object94- Verify activation via `GetInactiveObjects`95</Hybrid_Mode>9697<Workflow_Steps>98**MANDATORY**: Follow the step sequence defined in [`workflow-steps.md`](workflow-steps.md).99100Per-step model allocation (skill main thread runs on Sonnet 4.6 per frontmatter; creation delegates to `sap-executor`; the report is rendered on main):101102| Step | Owner | Model | Role |103|------|-------|-------|------|104| 0 Trust | skill-to-skill | Sonnet | permission bootstrap |105| 1 Classify | main | **Sonnet** | keyword → object type |106| 2 Metadata | main | **Sonnet** | name / package / transport / description (Q&A + `SearchObject` + `ListTransports` + naming validation) |107| 3 Pre-Creation Check | main | **Sonnet** | `SearchObject` (name-exists guard) |108| 3.5 Version Branch | main | **Sonnet** | `SAP_VERSION` ECC vs S/4 routing |109| **4 + 5 + 6 Create + Implement + Activate (standard flow)** | **`sap-executor`** with `model: "opus"` override | **Opus 4.7** | One dispatch covers: `CreateClass`/`CreateProgram`/... → `UpdateClass`/`UpdateProgram`/... with initial implementation code → `ActivateObjects` → `GetInactiveObjects` verify. The Opus override is justified because Step 5 is novel code generation (`common/model-routing-rule.md` § Tier 2) — field typing priority 1–4, class constructor + method signatures, FM inline parameter declarations, etc. |110| **4-ECC DDIC Helper Program (ECC fallback)** | **`sap-executor`** with `model: "opus"` override | **Opus 4.7** | ECC-only branch for Table/DTEL/DOMA. Executor picks the matching template from `skills/create-object/ecc/`, substitutes names, fills the field list per `common/field-typing-rule.md`, and `CreateProgram` + `UpdateProgram` + `ActivateObjects` the helper into `$TMP`. |111| **7 Completion Report** | main | **Sonnet** | Pure formatting from the executor's structured return — no agent dispatch. Localizes to the user's current conversation language. Render rules: `dispatch-prompts.md` § Step 7. For ECC fallback, use the mandatory report format there verbatim (do NOT rephrase the ⚠ header + 3-step SE38/SE11 checklist). |112113At Step 2 (metadata collection) — when the object belongs to a specific SAP module (MM table, SD structure, PS data element, …) — the main thread reads `SAP_ACTIVE_MODULES` from `sap.env` / `config.json` and consults [`../../common/active-modules.md`](../../common/active-modules.md). If companion modules are active, proactively suggest integration fields (e.g., creating an MM CBO table in a landscape with PS active → suggest adding `PS_POSID` / `AUFNR`). Do NOT add silently — propose to user and let them accept/decline, then pass the confirmed field list through to the executor dispatch.114</Workflow_Steps>115116<Naming_Convention_Enforcement>117**MANDATORY**: Always read `configs/common/naming-conventions.md` for the complete, authoritative ABAP naming conventions reference before creating any object.118119The reference file covers:120- General rules (prefix, case, character set, length limits)121- Module codes (SD/MM/FI/CO/...) for the `Z{MODULE}_...` pattern122- Object-specific patterns — Classes (ZCL_/ZIF_/ZCX_), Programs (ZR_), Function Groups/Modules, Data Dictionary (ZT_/ZDE_/ZDO_), UI (Dynpro/GUI Status), OData/RAP (Z_I_/Z_C_/Z_BP_/Z_SB_), Enhancements, IDoc/ALE123- Code-level naming (variables: LV_/LS_/LT_/IV_/EV_/MV_; constants GC_/LC_; types TY_; methods)124- Validation rules (uppercase, Z/Y prefix, character set, max length, non-generic)125126**Quick validation checklist (applied before every create):**1271. Starts with `Z` or `Y` (customer namespace)1282. UPPERCASE only, characters in `[A-Z0-9_]`1293. Within max length (30 chars for most objects)1304. Not generic (ZTEST/ZTEMP/ZDUMMY forbidden)1315. Object-type prefix follows the reference (e.g., `ZCL_` for classes, `ZIF_` for interfaces)1326. Screen = 4-digit number (e.g., 0100); GUI Status = uppercase identifier (e.g., STATUS_0100) — both require a parent program133134If the user-provided name violates any rule, suggest a compliant alternative based on `configs/common/naming-conventions.md` before proceeding.135</Naming_Convention_Enforcement>136137<MCP_Tools_Used>138- `SearchObject` — check for existing objects139- `ListTransports` — list available transports140- `GetPackage` — verify package existence141- `CreateClass` / `CreateInterface` / `CreateProgram` / `CreateFunctionGroup` / `CreateFunctionModule` / `CreateTable` / `CreateStructure` / `CreateDataElement` / `CreateDomain` / `CreateView` / `CreateServiceDefinition` / `CreateServiceBinding` / `CreateBehaviorDefinition` / `CreateScreen` / `CreateGuiStatus`142- `UpdateClass` / `UpdateProgram` / `UpdateScreen` / `UpdateGuiStatus` / etc. — write initial implementation143- `GetInactiveObjects` — verify activation144- **ECC DDIC fallback:** only `CreateProgram` + `UpdateProgram` (target `$TMP`). `CreateTable` / `CreateDataElement` / `CreateDomain` must NOT be attempted when `SAP_VERSION = ECC`.145</MCP_Tools_Used>146147Task: {{ARGUMENTS}}