Today , we will see how to add Folder in System Form Using SAP Business one Studio Suite
Call System Form in VS 2010 .
Go To System Form Code section.
Declare Control for Form :
Private WithEvents oFolder As SAPbouiCOM.Folder
Private WithEvents oFolder1 As SAPbouiCOM.Folder
Code for Multiple Folder:
Private Sub AddMultipleFolders()
Try
Dim oItem As SAPbouiCOM.Item = Nothing
Dim oItemRef As SAPbouiCOM.Item = Nothing
oItemRef = Me.UIAPIRawForm.Items.Item("1320002137")
'' Earning Folder
oItem = Me.UIAPIRawForm.Items.Add("MyFld", BoFormItemTypes.it_FOLDER)
oItem.Top = oItemRef.Top
oItem.Height = oItemRef.Height
oItem.Left = oItemRef.Left + oItemRef.Width
oItem.Width = oItemRef.Width
oItem.Visible = True
oFolder = oItem.Specific
oFolder.Caption = "Earnings"
oFolder.GroupWith(oItemRef.UniqueID)
oFolder.Pane = 25
'Create a matrix on the folder
oItem = Me.UIAPIRawForm.Items.Add("MyMtx", BoFormItemTypes.it_MATRIX)
oItem.FromPane = 25
oItem.ToPane = 25
oItemRef = Me.UIAPIRawForm.Items.Item("45")
oItem.Top = oItemRef.Top - 50
oItem.Left = 10
oItem.Width = Me.UIAPIRawForm.Width - 200
oItem.Height = 200
'' Deduction Folders
oItemRef = Me.UIAPIRawForm.Items.Item("MyFld")
oItem = Me.UIAPIRawForm.Items.Add("MyFld1", BoFormItemTypes.it_FOLDER)
oItem.Top = oItemRef.Top
oItem.Height = oItemRef.Height
oItem.Left = oItemRef.Left + oItemRef.Width
oItem.Width = oItemRef.Width
oItem.Visible = True
oFolder1 = oItem.Specific
oFolder1.Caption = "Deductions"
oFolder1.Pane = 26
oFolder.Item.LinkTo = "1320002137"
oFolder1.GroupWith("MyFld")
AddHandler oFolder.ClickBefore, AddressOf Me.oFolder_ClickBefore
AddHandler oFolder1.ClickBefore, AddressOf Me.oFolder1_ClickBefore
Catch ex As Exception
End Try
End Sub
Add Event:
Private Sub Form_LoadAfter(pVal As SAPbouiCOM.SBOItemEventArg)
'Throw New System.NotImplementedException()
AddMultipleFolders()
End Sub
Private Sub oFolder_ClickBefore(ByVal sboObject As Object, ByVal pVal As SBOItemEventArg, ByRef BubbleEvent As Boolean) Handles oFolder.ClickBefore
If pVal.ItemUID = "MyFld" Then
Me.UIAPIRawForm.PaneLevel = 25
End If
End Sub
Private Sub oFolder1_ClickBefore(ByVal sboObject As Object, ByVal pVal As SBOItemEventArg, ByRef BubbleEvent As Boolean) Handles oFolder1.ClickBefore
If pVal.ItemUID = "MyFld1" Then
Me.UIAPIRawForm.PaneLevel = 26
End If