Purpose Tabs can be created and designed in Visual Studio .NET and used on SAP GUI screens. (with GuiXT it is not possible to create SAP GUI tabs, only existing tabs can be modified) Many SAP GUI screens use tabs for easier handling. Nevertheless, there are often many areas left over, such as in transaction IW23, where you have to scroll down to find certain fields and data. In this example we add more tabs and only one area of the notification data is displayed for each selected tab. |
Solution
At the beginning we create a new application with Visual Studio. NET which we will later convert into a class library.
There we add a tabcontrol to a form and adapt it to our needs.
Then we can embed the windows form application with the tabcontrol:
if
G[Reference object]
if
not
G[Reference objec]
// embed
control The method "embed" in VB. NET: ' embed into SAP GUI window Public Sub embed(ByVal w As Object) Dim iconList = New ImageList iconList.TransparentColor = Color.Blue iconList.ColorDepth = ColorDepth.Depth32Bit iconList.ImageSize = New Size(16, 16) iconList.Images.Add(Image.FromFile("C:\Images\icon1.gif")) iconList.Images.Add(Image.FromFile("C:\Images\icon2.gif")) iconList.Images.Add(Image.FromFile("C:\Images\icon3.gif")) iconList.Images.Add(Image.FromFile("C:\Images\icon4.gif")) iconList.Images.Add(Image.FromFile("C:\Images\icon5.gif")) Me.TabControl1.ImageList = iconList Me.TabPage1.ImageIndex = 0 Me.TabPage2.ImageIndex = 1 Me.TabPage3.ImageIndex = 2 Me.TabPage4.ImageIndex = 3 Me.TabPage5.ImageIndex = 4 ' create guixt object for communication with GuiXT myguixt = New guixt 'myguixt.SetVariable("selectedindex", "0") guixt.EmbedForm(Me, w) End Sub To ensure that the tabcontrol reacts to user actions, we set up a GuiXT variable in its event handler and then rebuild the mask. The GuiXT script can then show or hide certain areas of the mask according to the set variable.
Private Sub TabControl1_SelectedIndexChanged(sender As Object, As EventArgs) Handles TabControl1.SelectedIndexChanged Dim myTabControl As System.Windows.Forms.TabControl = sender myguixt.SetVariable("selectedindex", _ myTabControl.SelectedIndex.ToString) myguixt.Input("OK:/0,process=tabcontrol_update.txt") End Sub
The specified InputScript can remain empty, but should be present.
if
V[selectedindex=0]
pos
G[Reference object]
(6,1)
endif
pos
G[Responsibilities]
(6,1)
endif
Result:
Please also have a look at this short video explaining the main workflow:
|
Components |