SAP GUI for Windows
Two settings let the agent work in SAP GUI: scripting on in SAP GUI, and allowed on the SAP system.
On Windows, the server reads and drives SAP GUI for Windows through SAP GUI scripting, the interface SAP GUI offers to scripts and test tools. It lists every open connection and session, with system, client, user and transaction, and works in the session you are in. It talks to SAP GUI through Windows PowerShell 5.1, which comes with Windows; nothing else is installed.
Turn scripting on
- In SAP Logon, open Options → Accessibility & Scripting → Scripting and tick Enable scripting.
- Untick Notify when a script attaches to SAP GUI and Notify when a script opens a connection, then restart SAP Logon.
- Ask your SAP Basis team to set the profile parameter
sapgui/user_scripting = TRUEon the SAP system (transaction RZ11, and in the default profile to keep it after a restart), then log on again. - Run
npx -y sap-ui-automation doctoras the same Windows user as SAP GUI, not as administrator. It prints a ✓ or a ✗ for each check.
Test and QA systems often allow scripting; production systems often do not. When a system does not, SAP GUI shows your session but scripting sees none of it, and doctor names the connection.
SAP GUI keeps its settings in the Windows registry. A value an administrator set for the whole machine wins over yours, and doctor says so: ask your IT team then. PowerShell must run in Full Language mode; where AppLocker or App Control restricts scripts, doctor reports the mode it found. SAP GUI guide
When doctor shows ✗
| doctor says | What to do |
|---|---|
| SAP GUI is running: not running | Start SAP Logon and log on. The server never logs on for you. |
| Scripting is on in SAP GUI: off | Tick Enable scripting and restart SAP Logon. Run the server as the same Windows user as SAP GUI, not as administrator. |
| Scripting is allowed on the SAP system: no session is visible to scripting | Ask Basis to set sapgui/user_scripting = TRUE, then log on again. Or use the network reader. |
| Notice “a script is attaching” is off: on | Untick both Notify boxes in the scripting options. |
| PowerShell may run the host: Constrained Language mode | Ask IT to allow the server’s script, or use Web GUI and Fiori in Chrome. |
Where scripting is not allowed: the network reader
The network reader is experimental. The server runs a SAProuter on 127.0.0.1:3298 and reads SAP GUI from its traffic (SAP’s DIAG protocol). It acts with the keyboard and, where SAP GUI has no key, the mouse. Nothing is loaded into SAP GUI.
- Start the server before you log on, since SAP GUI connects through it.
- In SAP Logon, edit the connection entry: put
/H/127.0.0.1/S/3298at the start of its SAProuter string, before your company’s router if there is one. - Log on again.
It cannot read connections encrypted with SNC. It has run on one ECC and one S/4HANA system, at one screen size and theme. Network reader guide
Questions
Which SAP GUI settings are needed?
Scripting enabled in SAP GUI (Options → Accessibility & Scripting → Scripting), the two Notify boxes unticked, and scripting allowed on the SAP system with the profile parameter sapgui/user_scripting = TRUE. npx -y sap-ui-automation doctor checks each one.
What if the SAP system does not allow scripting?
Use the network reader, which reads SAP GUI from its traffic through a SAProuter on your PC (experimental), or Web GUI and Fiori in Chrome, which need no scripting.
Does it work with SAP GUI for Java?
No. SAP GUI for Java has no scripting interface the server can use. On a Mac, use Web GUI or Fiori in Chrome.
