技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
s4hana-create-service-entry-sheet【数据与研究】Create Service Entry Sheets (SES) in SAP S/4HANA Cloud Public or on-prem private edition via OData V2 A_ServiceEntrySheet deep-insert at API_SERVICE_ENTRY_SHEET_SRV (Lean Services model). Use whenever the user wants to create, post, add, generate, seed, enter, or confirm service entry sheets on S/4HANA — phrases like "create SES for PO X", "make me a…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Create Service Entry Sheets on SAP S/4HANA Cloud Public (Lean Services). Verified end-to-end against SAP S/4HANA Cloud Public Edition 2026-05-12 — SES 1, 2, 3 posted via API.
Before any API call, before any tool use, do this check. Even if you already know credentials from earlier in the conversation — IGNORE that knowledge and re-check from scratch each invocation.
<current cwd>...".env file at ./.env (in the current working directory — NOT parent dirs, NOT ~/.env, NOT any memory file)SAP_HOST AND SAP_AUTH_MODE both present./.env from the bundled template (curl from https://raw.githubusercontent.com/ilia-inovaflow/s4hana-create-record-skills/main/.env.example), append .env to .gitignore if not already there, tell the user clearly what to fill in (auth mode + host + creds), and wait for them to say "ready" before making any API call. Never overwrite an existing .env.<host> in <auth-mode> mode. Proceeding with [task]."Never use credentials from conversation memory, from another project's .env, or from any tenant the user previously worked with in a different session. Each project gets its own .env. See shared/setup-check.md for the full rationale and edge cases.
Verbs: create / post / add / generate / seed / enter / confirm Objects: SES, service entry sheet(s), service confirmation(s) Counts: 1 to ~50 records.
0 + SERV material + AAC=K). Use s4hana-create-po with the service-PO recipe first if none exist.<cwd>/.s4hana-tmp/create-ses-<YYYYMMDD-HHMM>/. Never commit, never modify .env.MM_PUR_SES/119: PO not released after a 2-second wait — transient backend async)./sap/opu/odata/sap/API_SERVICE_ENTRY_SHEET_SRVA_ServiceEntrySheet, A_ServiceEntrySheetItem, A_SrvcEntrShtAcctAssignmentto_ServiceEntrySheetItem)SAP_COM_0146 — "Service Entry Sheet Integration" (must be added to comm user — common gap on fresh tenants)There's also an OData V4 variant at /sap/opu/odata4/sap/api_serviceentrysheet/srvd_a2x/sap/serviceentrysheet/0001/ — same data, different protocol. Use V2 for now (this skill targets V2).
For each SES, required:
| Field | Notes |
|---|---|
PurchaseOrder (header + item) | A service PO that exists and is released |
PurchaseOrderItem (item) | The cat-0 service line on that PO (NOT cat-A limit line) |
ConfirmedQuantity | Amount of service performed (typically partial — 25%-100% of order qty) |
QuantityUnit | Match the PO line unit (e.g. AU) |
NetPriceAmount | Match the PO line price |
Plant, Currency | From the PO line |
PostingDate | Must be in open MM posting period (often different from FI periods — typically 2-3 months back) |
ServicePerformanceDate / EndDate | Must be within the PO line's allowed performance window — typically must equal or follow the PO creation date |
ServiceEntrySheetName | Free text, 40 char max |
If the user said "auto", pull eligible PO lines from A_PurchaseOrderItem?$filter=ProductType eq '2' and PurchaseOrderItemCategory eq '0' and IsFinallyInvoiced eq false.
Before bulk:
SAP_COM_0146 is active (probe A_ServiceEntrySheet?$top=1 — 403 HTML = missing arrangement).T_T001B-equivalent OData if accessible. Cache result.Item.NetPriceQuantity, Item.PurchaseOrderDate etc.) so SES dates are valid.Minimal working envelope (verified):
{
"ServiceEntrySheetName": "<short label>",
"PurchaseOrder": "<po>",
"PostingDate": "/Date(<ms>)/",
"Currency": "EUR",
"to_ServiceEntrySheetItem": [
{
"ServiceEntrySheetItem": "10",
"PurchaseOrder": "<po>",
"PurchaseOrderItem": "<line>",
"ConfirmedQuantity": "<qty>",
"QuantityUnit": "AU",
"NetPriceAmount": "<price>",
"Currency": "EUR",
"Plant": "1010",
"ServiceEntrySheetItemDesc": "<short desc>",
"ServicePerformanceDate": "/Date(<ms>)/",
"ServicePerformanceEndDate": "/Date(<ms>)/"
}
]
}
Do NOT include to_AccountAssignment unless the user explicitly wants a different cost center than what's on the PO — SES auto-inherits the PO line's AAC/CostCenter/GLAccount, and explicit deep-insert often triggers MM_PUR_SES/128: accounting lines not numbered consecutively.
Same CSRF flow as the other OData V2 services in this collection — see ../s4hana-create-po/references/csrf-flow.md.
If response is MM_PUR_SES/119: Purchase order X is not released. for a PO created in the same session/seconds ago → wait 2s and retry once (transient backend async). The PO IS released; the SES backend just hasn't refreshed its cache yet.
After all POSTs, $expand=to_ServiceEntrySheetItem on 2-3 random SES to confirm. Show user: total created, SES ID range, supplier/PO distribution, any failures.
<cwd>/.s4hana-tmp/create-ses-<YYYYMMDD-HHMM>/
├── eligible-po-lines.json # candidate POs after filtering
├── create-log.jsonl # one line per attempt
├── results.json # final summary
└── verify-sample.json
references/envelope-template.md — full schema with all optional fieldsreferences/known-errors.md — error catalog (MM_PUR_SES/006, /015, /119, /128, M7/053, etc.)references/po-not-released-retry.md — the transient async pattern + retry algorithmscripts/bulk-ses-poster.mjs — reference implementation