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

Resetting matrix rows

Hello,

My form is in ADD Mode and i'm deleting some rows from it thru my code using the following code:

matItems = SBO_Application.Forms.ActiveForm.Items.Item("38").Specific

matItems.DeleteRow(intMatRow)

Now,

This deletes the row at intMatRow, but the matrix row numbers do not reset as they do when we select and delete a row manually.

For. eg.: if there are 3 rows in my matrix and i delete the first row, then the row numbers remain 2 and 3 for the remaining rows.

I want them to change to 1 and 2 as there are only 2 rows now.

Please help me with this.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Aug 11, 2009 at 11:47 AM

    Rohan

    Try this code

    matItems = SBO_Application.Forms.ActiveForm.Items.Item("38").Specific
    matItems.SelectRow(intMatRow, True, False)
    SBO_Application.ActivateMenuItem("1293")

    Anoop

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 11, 2009 at 12:12 PM

    1293 is the menu item uid of Delete Row.

    So do not delete the matrix row using DeleteRow() method.

    Instead try the code sent by me before.

    Anoop

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rohan

      try This

      in menu event pval before action false

      If pVal.MenuUID = "1293" Then

      If objForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Then

      For intCurrentRow = 1 To objMatrix.VisualRowCount

      objMatrix.Columns.Item("V_-1").Cells.Item(intCurrentRow).Specific.Value = intCurrentRow

      Next

      End If

      End If

      in item event for any validation regarding matrix use visualrowcount

      ex code:

      If objMatrix.Columns.Item(1).Cells.Item(objMatrix.VisualRowCount).Specific.Value = "" Then

      Call objMain.objUtilities.MatrixDeleteRow(FormUID, "11", objMatrix.VisualRowCount)

      End If

      Rgds

      Micheal

      Edited by: micheal willis on Aug 11, 2009 8:06 PM

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.