
📎 This article includes 1 downloadable practice file ↓
A recording is a list of steps. Once you can read it, you can change values, add loops and run it from Excel.
The object chain
| Object | Is |
|---|---|
| application | SAP GUI scripting engine |
| connection | One system you’re logged into (Children(0) = first) |
| session | One SAP window (mode) |
findById paths
session.findById("wnd[0]/usr/ctxtGD-TAB") means window 0, user area, a field whose technical name is GD-TAB. The prefix shows the type: ctxt input field with F4 help, txt text field, btn button, chk checkbox, tbar toolbar.
Common actions
.text = "T001" ' type into a field
.press ' click a button
.sendVKey 0 ' Enter (8 = F8 Execute, 3 = F3 Back)
.selected = True ' tick a checkbox
Where people go wrong
| Problem | Fix |
|---|---|
| “control could not be found by id” | Screen differs from the recording; check layout/variant |
| Script runs in the wrong window | Close extra sessions or pick the right Children index |
Use SAP GUI scripting only where your company allows it, on a test/quality system first, and never to bypass authorisations. Examples use standard transactions and made-up data.
Practice
Run the parameterised script and try different table names on a test system.
📎 Practice files for this article
- 📄Lesson 3 scriptExample script with comments; adjust transaction fields to your system. Test in a non-production client.⬇ VBS · 543 B
Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.
Stuck on a step? Ask a question and the AI answers using this article.