cancel
Showing results for 
Search instead for 
Did you mean: 

UI - Matrix rowcount

Former Member
0 Kudos

Hi All,

I am tring to get the total number of rows contained in the Sales Order Matrix. Does the rowcount property work?

I have tried the mymatrix.rowcount -1 but i always get 0 even after an event and the matrix contains many rows?

Code snippet:

'//VB.NET

'Other declarations assumed

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

Dim iRow As Integer

Dim oMtx As SAPbouiCOM.Matrix

Dim oForm As SAPbouiCOM.Form

Dim iCol As Integer

Dim sCellValue As String

If pVal.FormType <> 0 And pVal.Before_Action = False Then

Select Case pVal.EventType

Case APbouiCOM.BoEventTypes.et_LOST_FOCUS

Select Case pVal.ItemUID

Case SALES_GRID_MTX '38

iRow = pVal.Row

iCol = pVal.ColUID

If iCol = 1 Then

Dim iRowCount As Integer = 0

oForm = SBO_Application.Forms.Item(FormUID)

oMtx = oForm.Items.Item(SALES_GRID_MTX).Specific

iRowCount = oMtx.RowCount

sCellValue = oMtx.Columns.Item(1).Cells.Item(iRow).Specific.Value 'Works, no problem here

SBO_Application.MessageBox(iRowCount)

End If

End Select

End Select

End If

end sub

Regards Rayner

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You haven't listed the definition of SALES_GRID_MTX in your code. I suspect you might have defined this as a numeric type, and that is probably the cause. It should be the string value "38", not the number 38.

Regards,

John.

Answers (1)

Answers (1)

Former Member
0 Kudos

DOH!!!!!

Right you are )