sap-ui-automation
Works in SAP through the sap-ui-automation MCP tools (sap_look, sap_act, sap_sessions, sap_logon). Opens transactions, reads and fills screens, reads ALV lists, looks up, creates or changes documents, and runs several SAP sessions in parallel, in SAP GUI for Windows, Web GUI (SAP
Install
npx skills add https://github.com/DidroAI/sap-ui-mcp/tree/main/skills/sap-ui-automation
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install didroai-sap-ui-mcp@llmmart
git clone https://github.com/DidroAI/sap-ui-mcp.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole didroai/sap-ui-mcp collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Driving SAP screens with the sap_* tools
The tools work in the SAP sessions the user has open, as that user and
under their authorisations. They come from the sap-ui-automation MCP
server (sap-ui-automation:sap_look; the tool names are the same under any
server name). Each tool's description lists its actions and fields. This
skill gives the order of work and how SAP behaves.
Setup and repeatable tests
For first-time installation, follow the setup guide.
If an installed server’s tools are missing, check the MCP client configuration and restart the
client after setup. If no SAP session appears, run npx -y sap-ui-automation doctor
on the SAP machine and use its suggested fix for the intended surface.
The user handles credentials.
When the user asks for a regression test, use a clean test session. List
saved flows with sap_record {"op":"list"}. To record one, start with
sap_record (op: start, name and session id), perform the requested steps,
assert the expected field or status on the result, then stop. Replay the
named test on the verified test session and report the first failing step.
Recordings retain typed values. Recording guide
One screen, one call
Identify the target. List sessions with
sap_sessions, then inspect the intended screen usingsap_lookwith its exactsessionid. Check system, client, user, transaction and any popup. If the target disappears, list sessions again and verify the new id. Keep existing work intact. To start another transaction use a fresh session (sap_actwithnewSession: "VA03"). Use/nonly in a known clean session or with permission to discard its contents.Send the whole screen in one
sap_actwith the verified session ID: the fields you see, then the key that submits them.{"session":"<verified-id>","actions":[ {"do":"set","id":"ctxtVBAK-AUART","value":"OR"}, {"do":"set","id":"ctxtVBAK-VKORG","value":"1000"}, {"do":"key","key":0}]}Read the answer, not the screen again. The answer is the new screen (or only the lines that changed).
Ran k of n actions. Stopped: ...means the batch ended early, at a popup, a status message or another screen: go on from the screen it shows with the actions that did not run.Read the status bar first (
STATUS E: ...; toasts in Fiori).E: nothing went through, correct the field it names.W: Enter accepts it, when the warning is acceptable for the task.S: done.Report what you read or saved, with the document number from the status bar.
A write (Save, Post) on a screen the batch reached after you sent it does
not run. Read that screen in the answer, then send the write. Mark the step
"unseen": true only when you know the screen.
How SAP screens behave
- Fields take effect on Enter.
setonly types. SAP checks the input and fills dependent fields on Enter, so fill the screen, then press Enter once. - Do not guess codes (order type, plant, company code): open the value
help with
{"do":"f4","id":...}and pick from its list. /n<tcode>drops unsaved input in the current transaction.- Popups come first. A
WINDOW wnd[1]blocks the screen below until it is answered. - A list shows the rows on screen and the total. Never conclude that an
entry is missing from the rows on screen: read the others with
sap_lookand"id","rows":"100-150"."row"in an action is the number the view prints. - Numbers follow the user's notation. Trust the
NUMBERSline of the view: withNUMBERS 1.234,56, "1.000" is one thousand. When it saysunknown, find the notation before you read or type an amount. - Leaving without saving: Back (
key 3) or Cancel (key 12). When SAP asks whether to save, answer No unless the user asked you to save. - Fiori: open an app with
{"do":"open","app":"#PurchaseOrder-manage"}. The okcode/ngoes to the launchpad's home page.
Several sessions at once
Use one session per independent part of a task (look up one order while creating another, the same check in two systems).
Get a session per part.
sap_act {"newSession":"VA03","session":"<source-id>"}opens a fresh Web GUI tab in launched or attached Chrome, or a second desktop SAP window. Send it on its own: insideactionsit is refused.sap_logonwith"newSession": trueopens a new window with a logon of its own, on the same system or another. Only servers set up with the Chrome extension havesap_logon.
The new session becomes the active one.
Wait until it is verified. Use a session when the
sap_logonanswer saysverified, orsap_sessionslists it with its system, client and user. A Web GUI tab marked "not verified" is still loading or shows a popup: callsap_sessionsagain before you work in it.Pass
sessionon every call, with the id from the answer. Never rely on the active session. Calls on different sessions run at the same time, calls on one session run in order.Send the independent calls together, then check each answer against its own part (transaction, document number) and report each part as it finishes.
If SAP reports a session limit, dismiss its information popup. In Web GUI,
open the system’s normal Web GUI start URL in a separate tab. List sessions,
verify the new tab and use its ID. Repeating /o or closing another agent’s
tab can disrupt work. On desktop, use an available session or another logon.
SAP GUI for Windows: two ways to read it
sap_sessions lists SAP GUI sessions found by SAP GUI scripting and, for
connections logged on through the server's router, by the network reader
("through the DIAG router"). When one connection is listed both ways, use
the scripting session: it reads more of the screen. Use the network reader's
session when it is the only one listed, for example when scripting is off.
Logging on
Without sap_logon the server never logs on: ask the user to open SAP.
With it, log on only to a system sap_systems lists. When sap_logon
stops (wrong password, locked user, SAP asking about other logons), tell the
user what it says. Never retry on your own and never ask for a password.
Writing to SAP
Saving, posting, releasing and deleting change the system for real. The
user's write setting decides what happens, and sap_act says which one
applies:
- confirm (default): the server requests approval from the client. Codex Full Access can accept automatically. If they decline, ask how to go on. A client that cannot ask gets the action refused: tell the user what you would have saved and stop.
- off (read-only): the action is refused. Tell the user what you would have saved and stop.
- on: the action runs. Say what you saved, with the document number.
Save with {"do":"key","key":"Save"} on every surface (in Web GUI the
server presses the toolbar's Save button for it).
Never work around the setting, for example with a save code in the command field or another route to the same change. The setting is the user's decision, not an obstacle.
When a write did not run, report the unsaved edits and any document lock. Discard only your own disposable input or edits the user authorized you to discard. If ownership is unclear, leave the screen open and ask how to proceed.
Files (sap-ui-mcp)
-
SKILL.md 8.2 KB
--- name: sap-ui-automation description: Works in SAP through the sap-ui-automation MCP tools (sap_look, sap_act, sap_sessions, sap_logon). Opens transactions, reads and fills screens, reads ALV lists, looks up, creates or changes documents, and runs several SAP sessions in parallel, in SAP GUI for Windows, Web GUI (SAP GUI for HTML) and Fiori, on ECC or S/4HANA. Use this skill whenever the user wants something looked up, checked, created or changed in SAP, even if they name no tool or say only a transaction code (VA03, ME23N, MM03, FB03, MIGO) or a business object (sales order, purchase order, material, customer, vendor, invoice, delivery, goods receipt, Fiori app). Also use it to log on, set up or troubleshoot the SAP MCP tools, or record and replay SAP regression tests. Read it before the first sap_* call. --- # Driving SAP screens with the sap_* tools The tools work in the SAP sessions the user has open, as that user and under their authorisations. They come from the `sap-ui-automation` MCP server (`sap-ui-automation:sap_look`; the tool names are the same under any server name). Each tool's description lists its actions and fields. This skill gives the order of work and how SAP behaves. ## Setup and repeatable tests For first-time installation, follow the [setup guide](https://docs.didro.ai/sap-ui-automation/getting-started/setup-prompt). If an installed server’s tools are missing, check the MCP client configuration and restart the client after setup. If no SAP session appears, run `npx -y sap-ui-automation doctor` on the SAP machine and use its suggested fix for the intended surface. The user handles credentials. When the user asks for a regression test, use a clean test session. List saved flows with `sap_record {"op":"list"}`. To record one, start with `sap_record` (`op: start`, name and session id), perform the requested steps, assert the expected field or status on the result, then stop. Replay the named test on the verified test session and report the first failing step. Recordings retain typed values. [Recording guide](https://docs.didro.ai/sap-ui-automation/guides/record-replay) ## One screen, one call 1. **Identify the target.** List sessions with `sap_sessions`, then inspect the intended screen using `sap_look` with its exact `session` id. Check system, client, user, transaction and any popup. If the target disappears, list sessions again and verify the new id. Keep existing work intact. To start another transaction use a fresh session (`sap_act` with `newSession: "VA03"`). Use `/n` only in a known clean session or with permission to discard its contents. 2. **Send the whole screen in one `sap_act`** with the verified session ID: the fields you see, then the key that submits them. ```json {"session":"<verified-id>","actions":[ {"do":"set","id":"ctxtVBAK-AUART","value":"OR"}, {"do":"set","id":"ctxtVBAK-VKORG","value":"1000"}, {"do":"key","key":0}]} ``` 3. **Read the answer, not the screen again.** The answer is the new screen (or only the lines that changed). `Ran k of n actions. Stopped: ...` means the batch ended early, at a popup, a status message or another screen: go on from the screen it shows with the actions that did not run. 4. **Read the status bar first** (`STATUS E: ...`; toasts in Fiori). `E`: nothing went through, correct the field it names. `W`: Enter accepts it, when the warning is acceptable for the task. `S`: done. 5. **Report** what you read or saved, with the document number from the status bar. A write (Save, Post) on a screen the batch reached after you sent it does not run. Read that screen in the answer, then send the write. Mark the step `"unseen": true` only when you know the screen. ## How SAP screens behave - **Fields take effect on Enter.** `set` only types. SAP checks the input and fills dependent fields on Enter, so fill the screen, then press Enter once. - **Do not guess codes** (order type, plant, company code): open the value help with `{"do":"f4","id":...}` and pick from its list. - **`/n<tcode>` drops unsaved input** in the current transaction. - **Popups come first.** A `WINDOW wnd[1]` blocks the screen below until it is answered. - **A list shows the rows on screen and the total.** Never conclude that an entry is missing from the rows on screen: read the others with `sap_look` and `"id"`, `"rows":"100-150"`. `"row"` in an action is the number the view prints. - **Numbers follow the user's notation.** Trust the `NUMBERS` line of the view: with `NUMBERS 1.234,56`, "1.000" is one thousand. When it says `unknown`, find the notation before you read or type an amount. - **Leaving without saving:** Back (`key 3`) or Cancel (`key 12`). When SAP asks whether to save, answer No unless the user asked you to save. - **Fiori:** open an app with `{"do":"open","app":"#PurchaseOrder-manage"}`. The okcode `/n` goes to the launchpad's home page. ## Several sessions at once Use one session per independent part of a task (look up one order while creating another, the same check in two systems). 1. **Get a session per part.** - `sap_act {"newSession":"VA03","session":"<source-id>"}` opens a fresh Web GUI tab in launched or attached Chrome, or a second desktop SAP window. Send it on its own: inside `actions` it is refused. - `sap_logon` with `"newSession": true` opens a new window with a logon of its own, on the same system or another. Only servers set up with the Chrome extension have `sap_logon`. The new session becomes the active one. 2. **Wait until it is verified.** Use a session when the `sap_logon` answer says `verified`, or `sap_sessions` lists it with its system, client and user. A Web GUI tab marked "not verified" is still loading or shows a popup: call `sap_sessions` again before you work in it. 3. **Pass `session` on every call**, with the id from the answer. Never rely on the active session. Calls on different sessions run at the same time, calls on one session run in order. 4. **Send the independent calls together**, then check each answer against its own part (transaction, document number) and report each part as it finishes. If SAP reports a session limit, dismiss its information popup. In Web GUI, open the system’s normal Web GUI start URL in a separate tab. List sessions, verify the new tab and use its ID. Repeating `/o` or closing another agent’s tab can disrupt work. On desktop, use an available session or another logon. ## SAP GUI for Windows: two ways to read it `sap_sessions` lists SAP GUI sessions found by SAP GUI scripting and, for connections logged on through the server's router, by the network reader ("through the DIAG router"). When one connection is listed both ways, use the scripting session: it reads more of the screen. Use the network reader's session when it is the only one listed, for example when scripting is off. ## Logging on Without `sap_logon` the server never logs on: ask the user to open SAP. With it, log on only to a system `sap_systems` lists. When `sap_logon` stops (wrong password, locked user, SAP asking about other logons), tell the user what it says. Never retry on your own and never ask for a password. ## Writing to SAP Saving, posting, releasing and deleting change the system for real. The user's write setting decides what happens, and `sap_act` says which one applies: - **confirm** (default): the server requests approval from the client. Codex Full Access can accept automatically. If they decline, ask how to go on. A client that cannot ask gets the action refused: tell the user what you would have saved and stop. - **off** (read-only): the action is refused. Tell the user what you would have saved and stop. - **on**: the action runs. Say what you saved, with the document number. Save with `{"do":"key","key":"Save"}` on every surface (in Web GUI the server presses the toolbar's Save button for it). Never work around the setting, for example with a save code in the command field or another route to the same change. The setting is the user's decision, not an obstacle. When a write did not run, report the unsaved edits and any document lock. Discard only your own disposable input or edits the user authorized you to discard. If ownership is unclear, leave the screen open and ask how to proceed.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.