Purpose Use the built-in functions of the native
control interface for the toolbar control
For most tasks it is not advisable to
program your own VB functions that communicate with the special SAP
UI controls such as grid control or tree control. The SAP UI
controls are more complex than one might think, since they
handle user actions, read and write the SAP GUI datastream and
communicate with SAP application. So your VB function is player
number three or four in this system.
The following functions, built in into the GuiXT Controls
interface "guinet.dll", cover most of what is normally needed.Please observe:
All functions have obligatory
and optional parameters. We
suggest you use the "by name" calling for all optional
parameters.
All functions can either be called from your GuiXT script, in most cases with
CallVBAsync, or from your own VB.NET function. If you need to
evaluate the return code of the built-functions it is often more
practical to call up your own VB.NET function with
CallVBAsync and then call the built-in function from there.
Parameters 1 butName Internal name of the
button or button text 2 toolBarNo Default:
-1
Number of the toolbar on screen. The value -1 means: the button is
searched by its name in all toolbars on the screen
Parameters 1 itemname
Internal name of the menu button, followed by a dot and the internal name of the menu item, or number for the grid control toolbar (see section below) 2 toolBarNo Default:
-1
Number of the toolbar on screen. The value -1 means: the menu button
is searched by its name in all toolbars on the screen
Grid control toolbar For the grid control toolbar you need to use the number of the menu item instead of its id.
Example: In transaction SE16N we add a button to download the grid control content as a tab separated text file:
We need to select the third menu item:
The menu id is "&MB_EXPORT":
InputScript
GuiXT
// Transaction SE16N
// download table content to local file (tab separated text file)
Screen SAPLSE16N.0200
CallVBAsync guinet.toolbarcontrol.SelectMenuItem "&MB_EXPORT.3"
Enter
// Save list in file...
Screen SAPLSPO5.0110
Set R[Text with Tabs] "X"
Enter