Skip to Content
author's profile photo Former Member
Former Member

UI - Matrix rowcount

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

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 05, 2004 at 08:49 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2004 at 10:40 PM

    DOH!!!!!

    Right you are 😊)

    Add comment
    10|10000 characters needed characters exceeded