Skip to content

SAP GUI Automation

stud0709 edited this page Oct 21, 2026 · 8 revisions

SAP GUI Automation

The sap-dev AI skill includes a dedicated presentation-layer automation engine. It communicates directly with running SAP GUI for Java sessions on your workstation to enable autonomous navigation and screen inspection.


Key Capabilities

  • Zero-Setup Session Detection: Hot-attaches to existing, logged-in SAP GUI for Java sessions without requiring custom connection profiles or command-line parameters.
  • Generic Tree Control API: Complete automation of EnjoySAP and Shell tree controls (double_click, select, expand, collapse, click_link, press_button, change_checkbox, context_menu) with multi-column node inspection.
  • Declarative Table & Cluster Maintenance: Automates single-table (SM30) and view cluster (SM34) maintenance declaratively supporting INSERT, UPDATE, TRANSLATE (multi-language tables), and DELETE with adaptive 1-step/2-step view handling and positioning dialogs (SAPLSPO4:0300).
  • On-Demand Visual & Component Inspection: Extracts complete component hierarchies and captures lossless AWT frame screenshots on demand.
  • Declarative Smart Sequences: Executes multi-step macro sequences with parameter hydration (FIELDS, POSITION_FIELDS, ROWS), dynamic queries, assertions, and checkpoints.

Available MCP Tools

Tool Name Description
sap_gui_status Inspects active SAP GUI sessions, including active transaction code, program name, screen number, and window title.
sap_gui_inspect Inspects and extracts the visual element hierarchy of a specific SAP GUI window (locally or via remote Nostr tunnel). Requires SAP GUI for Java with sap-agent-bridge.jar.
sap_gui_action Executes interactive SAP GUI actions (setting fields, clicking buttons, selecting tabs, pressing function keys).
sap_gui_read_table Reads and extracts structured table rows and column headers from an active SAP GUI Table Control or ALV Grid with automated pagination. Supports local sessions and remote sessions via Nostr tunnel.
sap_gui_execute_sequence Executes a multi-step macro sequence in SAP GUI with parameter substitution, dynamic table-row queries, assertions, and milestone checkpoints.
sap_gui_manage_sequence Manages named, parameterized SAP GUI automation sequences in the local SQLite database. Supports saving, reading, listing, and deleting sequence definitions.
sap_gui_eval Evaluates raw JavaScript directly inside the active SAP GUI session (locally or via remote Nostr tunnel). Requires SAP GUI for Java with sap-agent-bridge.jar.
sap_maintain_customizing Maintains customizing tables and views using SAP GUI automation. Use sap_maintain_customizing_bcset when possible.
sap_request_gui_permissions Requests SAP GUI automation permissions for transactions, table maintenance, or customizing from the user.

Setup & Prerequisites

Execution evidence and recovery

Read execution on sap_gui_action and sap_gui_execute_sequence responses, including MCP errors. effect_certainty: "not_attempted" establishes that no native effect was attempted; unknown requires reconciliation. Ordered effects distinguish verified control assignments, attempted dispatch, and native method return. Sequence evidence retains completed_steps and each effect's original one-based step.

success and COMPLETED describe execution; application_result remains unverified until fresh technical evidence establishes the intended application result. A dispatch can take effect before a later timeout or error. Follow retry_directive: "inspect_before_retry" by inspecting the current state before repeating a request. Optional capture_error reports an unavailable screenshot or capture separately from the primary execution outcome. For trace activation, establish the target and off-state check beforehand and complete the approved recovery plan if the outcome is uncertain.

Installation

For detailed setup instructions, Java runtime requirements (JDK/JRE 17+), and SAP GUI for Java preferences configuration, see the Setup Guide.

For automating SAP GUI for Java running inside remote desktops, Citrix, or Windows Virtual Desktop (AVD), see the dedicated guide:
👉 Running SAP GUI for Java in VDI

For step-by-step instructions on debugging interactive SAP GUI sessions (Windows and Java) using MCP breakpoints, see:
👉 Debugging Tools & Workflows

Clone this wiki locally