start with the VBScript function call in GuiXT scripts, a feature that is useful
in its own right and in its application to ActiveX controls.
This is how you proceed:
file of type ".vbs", e.g. "lib1.vbs".
In this file write a VBScript function, for example:
test1 = "Hello World"
If you want to implement a big project with GuiXT Controls we recommend
you install a special VBScript editor that supports useful
features such as syntax check, pretty print and online help. Various
tools are available on the internet, for example, "VbsEdit":
choose a tool whereby the interfaces of ActiveX components
can be viewed; this will make it much easier to deal with complex
Enter the .vbs
filename you have chosen in GuiXT profile:
Later on you can add more ".vbs" files,
by semicolons, if an
file becomes too large.
You can define an unlimited number of functions in one VBScript file.
Please note: If
you change your VBScript code and want to perform a new test in a SAP GUI
window that is still running, you have to
a new SAP GUI mode with "/O...", since the old version of your VBScript
file is still active in the old mode. The
program is loaded once only in each SAP GUI mode so that global
variables retain their value.
Use the "CallVBS"
keyword in your GuiXT Script or InputScript to call your VBS function.
You can display the returned value with a "Message"
CallVBS msg = test1
This means that the VBS function "test1" is called and that the result
is set into the GuiXT variable V [msg].
If you are not interested in receiving the value returned by the
function, you simply use the syntax
As a result we see a SAP GUI message with the text from the