Enabled SAP GUI Scripting is a prerequisite for recognizing and interacting with SAP UI elements. If SAP Scripting is disabled, the corresponding selector values of the individual UI elements cannot be retrieved. Alternatively, one would have to use OCR and image recognition activities, which are typically less accurate and should therefore be avoided if possible. In order to access the UI elements of the application, SAP scripting must be enabled on the SAP server as well as on the clients, where the robot script is executed.
Enabling SAP GUI Scripting on the Server Side
- After starting the .exe and logging into your SAP server, the SAP Easy Access window opens.
- Run the transaction RZ11 (here, one can change profile parameters).
- Enter sapgui/user_scripting in the text field under Name/Parametername.
- Check if the current value is set to TRUE. If the value is FALSE, click on Change Value and set the New Value equal to TRUE. Confirm your changes by clicking the Save button. You might want to select the check box Switch on all servers if you operate multiple servers and you want to apply the changes to all of them.
- The changes do not affect your current session. After logging off and back on, the change should have been applied to your SAP environment. SAP scripting is now enabled.
Enabling SAP GUI Scripting on the Client Side
- Click on the Customize Local Layout button (or press Alt+F12) and select Options (or press O on your keyboard) from the appearing drop-down menu.
- The SAP GUI Options window opens. Select Accessibility & Scripting and then Scripting from the menu on the left side.
- Check the box Enable scripting under User Settings (it might already be checked by default)
- Verify that the options Notify when a script attaches to SAP GUI and Notify when a script opens are deselected. Otherwise, a popup appears every time when a robot script tries to interact with SAP, which would only introduce unnecessary complexity.
- Save your changes. SAP scripting is now also enabled on the local machine.
SAP Scripting Troubleshooting
If you followed the instructions above, but SAP Scripting still can't be accessed and you are not able indicate elements or textfields inside SAP, please check if the following icon is shown in the bottom right corner of SAP.
If it looks like this for you even if the other settings are set correcly, it might be the case that SAP Scripting is disabled for your user. In this case, please reach out to your IT-Administration to enable SAP Scripting on server side for your user.