Skip to Content
Former Member
Apr 28, 2016 at 08:58 AM

Add Row Number UDO Matrix


Dear All,

How to Add Row Number in UDO Matrix? I am using below code.

'Declare Variables

Private WithEvents SBO_Application As SAPbouiCOM.Application

Private WithEvents oForm As SAPbouiCOM.Form = Nothing

Private WithEvents oItem As SAPbobsCOM.Items

Private WithEvents oMatrix As SAPbouiCOM.Matrix

Public Sub New()

SBO_Application = SAPbouiCOM.Framework.Application.SBO_Application

oForm = Me.UIAPIRawForm

oForm = SBO_Application.Forms.ActiveForm()

End Sub

Private Sub SBO_Application_ItemEvent(FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent


Select Case pVal.Before_Action

Case True

Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_FORM_CLOSE

flag = 1

End Select

Case False

Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE

frmUid = pVal.FormUID

If flag = 0 Then

oForm = SBO_Application.Forms.ActiveForm()

oForm = DirectCast(SBO_Application.Forms.Item(frmUid), SAPbouiCOM.Form)

oItem = DirectCast(oApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems), SAPbobsCOM.Items)


oMatrix = oForm.Items.Item("0_U_G").Specific

For index As Integer = 1 To oMatrix.VisualRowCount

oMatrix.Columns.Item("#").Cells.Item(index).Specific.Value = 1

oMatrix.Columns.Item("#").Editable = False



flag = 1

End If

End Select

End Select

Catch ex As Exception


End Try

End Sub

When Form Opened , The Row Number displayed. But when i clicked Header of Matrix , The Value was removed.