Step 5: Analyze the VBS script

Hate manual data entry work? How about a typing in a few hundred line items in purchase orders with descriptions like "BOWMA-TORQ HX HD CAP SCR 1/2-13X1-1/2"? If the items do not exist as material numbers, you have no choice but to type their description by hand ... Except, of course, if you automate it with a smart SAPGUI script. Veteran Basis guru Giovanni Davila walks you through the process in this handy step-by-step guide. This is step 5.

Once you stop the recording a Visual Basic Script is created.
You can edit it in Notepad (or any other text editor).
Notice that the script has different sections:
1. A header.
2. Command lines with the data you entered.
3. Scroll lines.

If the SAPGUI screen was not maximized at the time of recording, you will see a line indicating the size. Example:
session.findById("wnd[0]").resizeWorkingPane 149,32,false

I recommend you change it to maximize the screen. That is, use this statement instead: session.findById("wnd[0]").maximize

Take note of the positions used to enter the data into each field and the scrolling that takes place.

VBS Script.

Line item data in VBS script.

More line item data in VBS script.

Scroll command lines in VBS script.


 Home: Introduction
 Step 1: Setting the stage
 Step 2: Activating SAPGUI scripting
 Step 3: Preparing the input data file
 Step 4: Recording the data entry
  Step 5: Analyzing the VBS script
 Step 6: Automating the VBS script creation
 Step 7: Running the VBS script program generator
 Step 8: Playing the VBS script to enter the line items
 Step 9: Troubleshooting
 Review: Conclusion and more resources

Dig Deeper on SAPscript and Smart Forms