Quick answer

How do I enable SAP GUI scripting?

To enable SAP GUI scripting, switch it on in two places. Basis sets sapgui/user_scripting to TRUE in RZ11 and in the instance profile, which keeps it after a restart. On each PC, tick Enable scripting in SAP GUI Options under Accessibility & Scripting. PostNow.ai needs both for Record, recorded-template runs, Debug, Call Transaction and SAP GUI test steps.

  • Both switches, every time. The server parameter overrides the PC setting: with FALSE on the server, no script runs, whatever SAP Logon says.
  • RZ11 alone is temporary. SAP drops a value set in RZ11 at the next restart, so the profile entry is what keeps scripting on.
  • It can be limited. sapgui/user_scripting_per_user restricts scripting to users with authorization object S_SCR.

This page is for the Basis administrator who gets the request, and for the SAP user or PostNow.ai designer who sees "scripting is switched off". It covers the server switch, the SAP Logon switch, the related parameters, the security questions, and a troubleshooting table. If scripting must stay off, the SAP GUI scripting alternative page covers the routes that post without driving screens.

Why PostNow.ai needs SAP GUI scripting

PostNow.ai needs SAP GUI scripting for every action that works in an SAP GUI window: it attaches to SAP GUI through SAP's scripting interface to log on, start a recording, start PostNow.ai's replay report (which posts with CALL TRANSACTION inside SAP) and open transactions. BAPI and API templates post over RFC and HTTP and open no SAP GUI window.

PostNow.ai actionNeeds SAP GUI scriptingHow it reaches SAP
Record (a designer records a transaction for a recording template)YesOpens a session in SAP GUI on the designer's PC and starts the SHDB recording through PostNow.ai's ZPOSTNOW_* recording report
Run and Simulate of a recorded templateYesStarts PostNow.ai's replay report in an SAP GUI session on the user's PC; the report replays the recording with CALL TRANSACTION inside SAP
Debug of a recorded templateYesReplays the recording in the user's SAP GUI, showing every screen or only the screens with errors
Call Transaction and opening a transaction from a query resultYesOpens the transaction in SAP GUI; for ME23N, VA03, MM03, FB03, XK03 and XD03 the document or master record number is filled in
SAP Testing: recording and playing SAP GUI test stepsYesRecords with SAP GUI's own script recorder and replays in a new SAP GUI window of the tester's logon
BAPI templates: Simulate, Run, Retry FailedNoCalls the BAPI over RFC; Simulate ends with BAPI_TRANSACTION_ROLLBACK
API templates: OData V2, OData V4, SOAPNoCalls SAP's published API over HTTP
Reports and Mass Change downloadsNoReads SAP tables over RFC; Mass Change posts the changed rows through its template's own route
ValidateNoChecks the sheet offline in Excel: required fields, type, length, characters, dates, decimals, allowed values

When PostNow.ai opens SAP GUI and a switch is off, it says which one: "SAP GUI scripting is switched off on this computer" for the SAP Logon option, or "SAP system <SID> does not allow SAP GUI scripting", with your system ID, the parameter and RZ11, for the server.

PostNow.ai logs in to SAP GUI only on the user's own computer, with the user's own stored login, when the user starts the action: Record, Run, Debug or Call Transaction. Never on a server, never unattended, never with someone else's login. The stored login is encrypted for that Windows user on that PC, and every SAP authorization check runs as it does for the user at the keyboard.

So enable scripting on the SAP system, and in SAP Logon on the PCs of designers who record, of users who run recorded templates or use Call Transaction, and of testers with SAP GUI steps. A team that posts only through BAPI and API templates works without an SAP GUI session.

SAP GUI scripting is switched on in two places

SAP GUI scripting runs only when the SAP system allows it and the SAP GUI on the PC allows it, and PostNow.ai names the one that is off when it opens SAP GUI. By default the server switch is off on every SAP system, while the PC switch is on wherever the scripting component is installed and IT has not turned it off.

WhereSettingWho changes itWhen it takes effect
SAP application serverProfile parameter sapgui/user_scripting = TRUEBasis, in RZ11 (until the next restart) and in the instance profile (permanent)At the user's next logon to that server
PC, per userSAP GUI Options › Accessibility & Scripting › Scripting › Enable scripting (registry value UserScripting under HKEY_CURRENT_USER)The user, unless IT has locked itAfter SAP Logon is restarted
PC, per machineRegistry value UserScripting = 0 under HKEY_LOCAL_MACHINE, or a SAP GUI installation package without scriptingDesktop ITUsers cannot override it

The server parameter overrides the client setting, so it is the one to ask for first (SAP Help). The two switches belong to two teams, which is why the request often takes longer than the change itself.

Enable it on the server: sapgui/user_scripting in RZ11

For PostNow.ai and any other SAP GUI script, Basis enables scripting on the server by setting sapgui/user_scripting to TRUE in transaction RZ11, then making the same value permanent in the instance profile. SAP documents the RZ11 steps on the SAP Help Portal.

  1. Open RZ11. Enter sapgui/user_scripting and choose Display. If RZ11 cannot find the parameter, the system's support package level is too low for it.
  2. Change the value. Choose Change value and enter TRUE in capitals; SAP reads any other spelling as FALSE.
  3. Switch on all servers. On a system with several application servers and load balancing, tick Switch on all servers. Without it, the value changes only on the server you are logged on to.
  4. Save, then log off and on. The current value shows TRUE. No restart is needed, but sessions that were already open keep the old setting.
  5. Make it permanent. Add sapgui/user_scripting = TRUE to the instance profile in RZ10. SAP states that a value set in RZ11 "will be lost when the system is restarted".

Steps 1 to 4 come from SAP's SAP GUI Scripting Security Guide, which also points to SAP Note 480149. A common pattern is RZ11 in a test client to prove the use case, then the profile change through the normal Basis change process.

Enable it in SAP Logon on the PC

On the PC, PostNow.ai uses the same SAP GUI option every script uses: Enable scripting, under SAP GUI Options › Accessibility & Scripting › Scripting. The Options dialog opens from SAP Logon, from a running SAP GUI session or from the Windows Control Panel.

  1. Open SAP GUI Options. In SAP Logon, open the menu in the top-left corner and choose Options. Menu labels move a little between SAP GUI releases; the Options dialog itself is the same.
  2. Go to Accessibility & Scripting › Scripting. Tick Enable scripting.
  3. Decide on the two notifications. "Notify when a script attaches to SAP GUI" and "Notify when a script opens a connection" are on by default. PostNow.ai's own setup help asks for both to be cleared, so an attach popup does not hold a recording or a replay; follow your security policy here.
  4. Restart SAP Logon. Close every SAP GUI window and SAP Logon, then start SAP Logon again.

If Enable scripting is greyed out, IT has set it centrally, and only IT can change it. The values behind the checkboxes are UserScripting, WarnOnAttach and WarnOnConnection under HKEY_CURRENT_USER\SOFTWARE\SAP\SAPGUI Front\SAP Frontend Server\Security, where 1 is the default for all three; IT can roll the same values out to every PC by policy.

Check that SAP GUI scripting works

PostNow.ai names the switch that is off when it opens SAP GUI for you. Without PostNow.ai, three checks tell you which side is blocking.

  • RZ11 on each application server. Display sapgui/user_scripting and read the Current value. A value that differs between servers explains a script that works only sometimes.
  • The scripting icon in SAP GUI. SAP GUI shows a scripting icon: in the status bar in older themes, and in the system information area of the header in Belize and newer themes. It shows while a script runs, and its tooltip says when scripting is disabled.
  • A one-line call. From Excel VBA, GetObject("SAPGUI").GetScriptingEngine returns the engine when the PC allows scripting. A connection to a system with FALSE on the server reports itself as disabled by the server, and a script cannot work with its sessions.

The most common "it worked yesterday" case is a restart: a value set only in RZ11 is gone, and the instance profile never had the entry.

The related parameters your Basis team will ask about

For PostNow.ai, the parameter that matters most after sapgui/user_scripting is sapgui/user_scripting_per_user, because it lets Basis enable scripting for the people who record and run, and nobody else. The others narrow what a script may do; they take effect only once sapgui/user_scripting is TRUE.

Profile parameterWhat TRUE doesWhat it means for PostNow.ai
sapgui/user_scriptingAllows scripting on the application server. Off by default; overrides the PC setting.Required on every server the designers, operators and testers log on to.
sapgui/user_scripting_per_userScripting stays available on the logon screen for everyone; after logon, only for users with authorization object S_SCR, activity 16 (Execute). Default FALSE (SAP Note 983990).Give S_SCR to the users who record, run recorded templates, use Call Transaction or run SAP GUI test steps.
sapgui/user_scripting_set_readonlyScripts may only read: no call that changes what is sent to the server, even without a database update.PostNow.ai enters values in SAP GUI to log on, record and replay, so those users need full scripting, for example through per_user.
sapgui/user_scripting_disable_recordingSwitches off scripting events: existing scripts still run, new scripts cannot be recorded.SAP Testing records SAP GUI test steps with SAP GUI's own recorder, so record those steps on a system where this is FALSE.
sapgui/user_scripting_force_notificationAlways shows the notification popup, whatever the PC's notification boxes say.Users answer the popup each time PostNow.ai attaches to SAP GUI.
sapgui/nwbc_scriptingSame as user_scripting plus set_readonly; meant for SAP Business Client side panels.Read-only scripting, as above.

Up to SAP GUI 7.40 patch 16 and 7.50 patch 3, set_readonly overrode per_user for everyone. Later patches add a switch: with the registry value ScriptingPerUserAccountExecute = 1 under HKEY_LOCAL_MACHINE on the PC, users with S_SCR get full scripting and everyone else read-only scripting (SAP Note 2565390). Parameter effects are from the SAP GUI Scripting Security Guide; check each in RZ11 on your release.

SAP GUI scripting security: what to tell your security team

PostNow.ai uses SAP GUI scripting inside the user's own session, so it adds no permissions: SAP sees the same user, runs the same authorization checks and applies the same field checks as for typing. SAP's own Security Q&A says the same: a script can only reach data the user may see.

The real concerns are the ones SAP lists, and each has a control:

ConcernWhy it is realControl
Speed and volumeA script works much faster than a person, so a wrong script can enter more bad data before anyone notices.Limit scripting to named users with per_user; in PostNow.ai, Validate the sheet and Simulate in SAP before Run.
Scripts that run unnoticedA script could attach to a session the user is working in.The notification popups, or force_notification from the server.
Screen data copied outA script can read every cell of a table control or ALV grid on the screen, even when list download is not allowed.disable_recording, per_user, or no scripting on systems that hold the most sensitive data.
Passwords in script filesA VBScript that logs on often carries the password in plain text.SAP advises never to write passwords into scripts. PostNow.ai keeps the user's own SAP login encrypted for that Windows user on that PC.
Control on the desktopThe PC switch is per user unless IT locks it.Set UserScripting centrally under HKEY_LOCAL_MACHINE, or install SAP GUI without the scripting component.

The usual compromise is sapgui/user_scripting = TRUE with sapgui/user_scripting_per_user = TRUE, and S_SCR in a role for the people who need it. For a PostNow.ai rollout, that role goes to designers, operators of recorded templates and testers with SAP GUI steps.

Troubleshooting: popups, greyed-out options, scripts that cannot attach

PostNow.ai names the switch that is off; the table covers the cases behind that message and the ones a VBA macro meets.

SymptomCauseFix
Scripting worked yesterday and is off todayThe value was set only in RZ11, and the system was restartedAdd sapgui/user_scripting = TRUE to the instance profile
It works on some logons and not othersSet in RZ11 without Switch on all servers, or the profiles differ between application serversSet the value on every server, then compare RZ11 per server
RZ11 was changed, but the session still says scripting is disabledThe session was open before the changeLog off and log on again
RZ11 does not find the parameter, or the value stays FALSE after savingParameter not found: support package level too low. Value stays FALSE: typed in lower case, or the kernel patch is missingEnter TRUE in capitals; if it still stays FALSE, Basis checks the kernel patch level
Scripting works on the logon screen, then stops after logonsapgui/user_scripting_per_user = TRUE and the user has no S_SCRAssign a role with S_SCR, activity 16
A popup asks whether a script may attach, on every runThe notification boxes are ticked, or Basis set user_scripting_force_notificationClear both boxes in SAP GUI Options if your policy allows; otherwise the server setting wins
Enable scripting is greyed outIT set the option centrallyAsk desktop IT to allow it for the users who need it
A script reads values but cannot type into a fielduser_scripting_set_readonly or nwbc_scriptingFull scripting for the users who post, for example through per_user and S_SCR
Script Recording and Playback records nothinguser_scripting_disable_recordingRecord on a system where it is FALSE; playback still works

VBA errors such as 619, "The control could not be found by id", come from the script, not from the switches; they are covered with the other script failures on the SAP GUI scripting alternative page.

Frequently asked questions

How do I enable SAP GUI scripting?
Switch it on in two places. On the SAP system, Basis sets the profile parameter sapgui/user_scripting to TRUE in RZ11, ticks Switch on all servers, and adds the same value to the instance profile so it survives a restart. On each PC, tick Enable scripting in SAP GUI Options under Accessibility & Scripting, then restart SAP Logon. Users log off and on to pick up the server change. PostNow.ai's recording features and any VBA macro use these same two switches.
Does SAP GUI scripting need to be enabled on the server and the client?
Yes. The server parameter sapgui/user_scripting must be TRUE, and Enable scripting must be ticked in SAP GUI Options on the PC. The server setting overrides the PC: with FALSE on the server, no script can work with that system's sessions. The PC option is on by default once SAP GUI scripting is installed, unless IT has switched it off.
How do I make sapgui/user_scripting permanent?
Add sapgui/user_scripting = TRUE to the instance profile (RZ10). A value changed in RZ11 takes effect at the next logon without a restart, but SAP drops it when the system restarts. On a system with several application servers, set it on all of them, or scripting works only on some logons.
Why does SAP GUI show a popup every time a script runs?
Because "Notify when a script attaches to SAP GUI" or "Notify when a script opens a connection" is ticked in SAP GUI Options under Accessibility & Scripting; both are on by default. Clear them if your security policy allows. If Basis has set sapgui/user_scripting_force_notification to TRUE, the popup appears whatever the PC settings say.
Can SAP GUI scripting be enabled for only some users?
Yes. Set sapgui/user_scripting_per_user to TRUE together with sapgui/user_scripting. Scripting then stays available on the logon screen for everyone, and after logon only for users with authorization object S_SCR, activity 16 (SAP Note 983990). For PostNow.ai, give S_SCR to designers who record, users who run recorded templates or use Call Transaction, and testers with SAP GUI steps.
Is SAP GUI scripting a security risk?
It adds no permissions: a script works in the user's own session, under the same authorization and field checks as typing. The risks SAP names are speed (a wrong script enters more bad data before anyone notices), screen data copied out of tables and grids, scripts attaching unnoticed, and passwords written into script files. Per-user scripting, read-only mode, forced notifications and a central PC policy address them.
Does SAP GUI scripting work with S/4HANA and SAP GUI 8.x?
Yes. SAP publishes the SAP GUI Scripting API for SAP GUI for Windows 8.00, and S/4HANA systems use the same sapgui/user_scripting parameter and the same SAP Logon option. PostNow.ai records and replays transactions in SAP GUI against both ECC and S/4HANA.
Which PostNow.ai features need SAP GUI scripting?
PostNow.ai uses SAP GUI scripting for Record, for Run, Simulate and Debug of recorded templates, for Call Transaction and for SAP GUI test steps in SAP Testing. BAPI templates post over RFC and API templates over HTTP, and reports read SAP over RFC, with no SAP GUI window. PostNow.ai logs in to SAP GUI only on the user's own computer, with the user's own stored login, when the user starts the action: Record, Run, Debug or Call Transaction. Never on a server, never unattended, never with someone else's login.
Scripting on, PostNow.ai ready

Record once in SAP GUI, then post from Excel

With scripting allowed, designers record a transaction in their own SAP GUI and publish it as a template. BAPI and API templates post over RFC and HTTP. Validate checks every row in Excel before Run, and each row gets SAP's message back.

Start free trial
  • 14-day free trial
  • Works with ECC and S/4HANA
  • Posts under your own SAP login