Purpose |
In a VB.NET
function that has been invoked with
CallVB
or
CallVBAsync
you can access GuiXT script variables via the class "guinet.guixt".
This class also provides several additonal functions. e.g.
SAP GUI scripting interface. Prerequisites:
In order to use the class "guinet.guixt"
it suffices to create an object of this class: |
GetVariable() |
r = guixt.GetVariable(var) Reads a GuiXT script variable and returns its content. Example:
Dim menu_icon_path
As String |
SetVariable() |
guixt.SetVariable(var,value) Sets the value of a GuiXT script variable. Example:
guixt.SetVariable("menu_icon_path",
"C:\guixt\menu\icons") |
GetText() |
r = guixt.GetText(var) Reads a GuiXT long text variable and returns its content. Example:
' read menu |
SetText() |
guixt.SetText(var,value) Sets the value of a GuiXT long text variable. Example: Dim lines() As String...
guixt.settext("menu_layout",
String.Join(vbCrLf,
lines)) |
GetControl() |
obj = guixt.GetControl(id, [n=1]) Native interface to a special control currently displayed in the SAP GUI window. As "id" you may use the following strings:
"grid" GridView Control Example: Imports
GRIDVIEWLIB ... Dim gridview As GridView = guixt.GetControl("grid")Dim
tb1 As ISAPToolBar =
guixt.GetControl("toolbar", 1)
Please note that the native
control interface should be used for special cases only. Normally SAP
GUI Scirpting is the best way of dealing with the SAP GUI controls. For
further details see "Tips, Tricks and Samples" -> "Native Control
Interface" |
Value() |
r = guixt.Value(var) Replaces all GuiXT &-variables with their values and returns the resulting string. Example:
Dim matnr
As
String |
Input() |
guixt.Input(s) The given string is interpreted by GuiXT as an input string; see the input= option of the Image command for details. Example:
guixt.input("U[VBELN]:" & ListView.selectedItem) |
Process() |
guixt.Process(funcname, par1, par2, ...)) Corresponds to the GuiXT instruction Process. From the first parameter funcname the script name "process_[funcname].txt" is formed. This script is executed, whereby the parameters of the script are occupied by the values of par1, par2,... . The string set at "Return" in the script is returned. |
FilePath() |
guixt.FilePath(s, [cache=True]) The given string is interpreted as a relative path in the current GuiXT script folder.
WIth the default option cache=True external files are first looked up in cache. Examples:
imgpath = guixt.FilePath("images\home.gif")
imgpath = guixt.FilePath("http://www.synactive.com/images/s10logo_blue.gif") |
EmbedForm() |
guixt.EmbedForm(ByVal
f As Form, ByVal c As Object) As Boolean Embeds an interactive Windows form into the SAP GUI window. Use the ActiveX object "Shell.Explorer" as a place holder in the SAP GUI screen. Example: Control (10,20) (18,80) progID="Shell.Explorer" name="d1" initFlag="d1init"if V[d1init]CallVB utilities.customer.preview "&V[d1]" endif VB.NET:
Imports guinet.... Public Sub preview(ByVal w As Object) ' create new form Dim f As New Dialog1() ' embed into SAP GUI window guixt.EmbedForm(f, w) End Sub
|
GuiSession() |
guixt.GuiSession() Returns an object of class guinet.sapguisession that you can use to execute SAP GUI scripting functions. For details see GUI Scripting in VB Example: guixt.GuiSession.Enter( "/NFB01")
|
GuiWindow() |
guixt.GuiWIndow()
Returns an object of class System.Windows.Forms.NativeWindow,
allowing the unique identification of the SAP mode. |
Components | GuiXT + Controls |