cancel
Showing results for 
Search instead for 
Did you mean: 

New Matrices on System Forms

Former Member
0 Kudos
172

Is it possible to create an additional matrix on a system form? If so, how? I would greatly appreciate a code sample for doing this. Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hello Scott,

You need to catch the et_Form_Load event of your form, and then you can add the matrix the same way you add matrix on user form.


Public Sub Handle_SBO_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles oApplication.ItemEvent
If pVal.BeforeAction = False Then
  If pVal.FormTypeEx="FormType of the system form" then
    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD Then
      Dim oFom as SAPbouiCOM.Form
      oForm = oApplication.Forms.Item(FormUID)
      Dim oItem As SAPbouiCOM.Item
      Dim oMatrix As SAPbouiCOM.Matrix
      Dim oColumns As SAPbouiCOM.Columns
      Dim oColumn As SAPbouiCOM.Column
      oItem = oForm.Items.Add("UMatrix", it_Matrix)
      oItem.Top=100
      oItem.Left=100
      oMatrix = oItem.Specific
      oColumns = oMatrix.Columns
      oColumn = oColumns.Add("#", it_EDIT)
      oColumn.TitleObject.Caption = "#"
      oColumn = oColumns.Add("A", it_EDIT)
      oColumn.TitleObject.Caption = "A"
      oColumn = oColumns.Add("B", it_EDIT)
      oColumn.TitleObject.Caption = "B"
    End if
  End if
end if
End Sub

Answers (0)