Record VB Script

Estimated reading: 2 minutes 1678 views

Enabling the SAP GUI automation engine simplifies the process of recording user actions performed in the SAP GUI. This generates VBScript code as output, which can be used in Robility Designer activities to automate these actions.

Ensure that the SAP GUI scripting configurations are done.

1. Open SAP Logon, and then select the SAP system to which you want to sign in.

2. Select Customize Local Layout (Alt F12), and then select Script Recording and Playback.

3. Select More.
4. Under Save To, provide the path and file name where you want to store the captured user interactions.


5. Select Record Script to start the screen capturing process.
6. Every interaction you do in SAP will be captured as repeatable VBScript commands.
7. Select the Record and Playback dialog, select Stop Recording, and then close the dialog.
8. Close all SAP windows now.

SAP’s scripting engine records each click as VBScript commands and saves it to the output file you provide. Open the file in your code editor of choice to examine its contents.

Once the script is available in the provided path, there is a crucial step to follow before using this activity in “Invoke DLL” in Robility Designer.

1. Open the VB script saved in your local.
2. Find where all the inputs are passed as values that are required to perform actions.
3. The values will be as below,
a. Session.findById(“wnd[0]/usr/ctxt$8A-YEAR”).text=”samplevalue” .
4. Since we are performing this script via the “InvokeDLL” activity, we must pass the values as arguments in the script. Therefore, all the parameters that require input to be passed from the activity need to be modified as below:
a. Session.findById(“wnd[0]/usr/ctxt$8A-YEAR”).text=WScript.Arguments(0)
5. This will enable the arguments for the inputs to be passed from the activity.
6. Ensure that the value of the first argument starts from “0”, so the second argument needs to be passed as WScript.Arguments(1) and so on.

Share this Doc

Record VB Script

Or copy link

CONTENTS