SAP GUI macros without coding?
Learn to record your own SAP GUI macros in 3 simple steps and WITHOUT CODING
Works with any version of SAP (as long as it is SAP GUI), and with all modules and transactions (Supply Chain, Master Data, Finance, etc.)
Summary
SAP settings to allow SAP GUI macros
- Click on the cogwheels and then go to Options

- Go to the “Accessibility & Scripting” section and then to “Scripting”
- Tick the “Enable scripting” checkbox
- Untick the other three checkboxes: this disables the pop up windows that appear when you run a macro

Once macros are enabled, click on the cogwheels: the “Script Recording and Playback” submenu is now available.
Three buttons allow you to control the recording of your SAP GUI macros:
- The green button, which runs a macro
- The red button, which records a macro
- The grey square button, which stops the macro recording

Click “More” and two additional options appear:
- “Save to”: full path (folder where the macro is saved once the recording is finished) with the macro name and extension
- “Save As”: script encoding (do not change)

Record your first SAP GUI macro
- Think in advance about what you want to record. Once recording has started, each of your actions will be recorded. It is better to know beforehand which actions you want to perform.
- Once this step is done, click the red button to start recording.
- Enter your transaction, then carry out the operations you want. Warning: overwrite the fields you are interested in and that contain data (even if it is just to type the same value again). This will allow you to modify those fields later on (see part 3).
- Once you are satisfied, press the grey square button.
- Your macro has just been saved in the location you specified in part 1.
Now, to run your macro, simply click the green button and select the file you saved earlier. The macro starts immediately.
Edit your macro to adapt it to your needs
It is very likely that you will need to modify your macro without recording everything a second time. That is absolutely possible.
Right click your macro file and choose “Edit”. Notepad opens.
Here is how the code of the SAP GUI macro you have just recorded is structured:
The macro code may seem very unclear at first.
In reality, it is quite understandable; you can clearly see what each line does and what you can change.

Everything that is between quotes "" corresponds to the fields you filled in while recording. You can edit them directly in the code according to your needs without having to record the entire macro again.
When you have finished your changes, do not forget to save (CTRL+S)!
You now know how to enable SAP GUI macros, record them and edit them.
I invite you to check out the second part, where you will learn how to link your SAP GUI macros to an Excel sheet (and therefore run your SAP macros directly from Excel), which will open up a huge range of possibilities for you!
Thank you for following this tutorial.
Lucas