Skip to Content
author's profile photo
Former Member

Customize Right-Click menu in Matrix

Hi,

My default right-click menus on the matrix in UDO form are different with the right-click menus in System form. How can I enable and disable this menus?

Eg. I would like to disable the 'Remove' and enable 'Add Row', 'Delete Row', 'Duplicate Row' for the matrix in UDO form right-click menu.

I am using VB and 2004B. Help appreciated.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • author's profile photo
    Former Member
    Posted on Oct 03, 2005 at 10:09 AM

    Sebastien,

    I have all items on the form bound to UDO tables using screen painter. Do I have to flush/clear datasource in my case? Thanks.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I'm not 100% sure, but I think when you delete, you don't need to code anything.

      but to add a row, you need to clear the dbdatasource linked to the table, and then oMatrix.addrow

  • author's profile photo
    Former Member
    Posted on Oct 02, 2005 at 05:22 PM

    You can easily remove the 'Add Row', 'Delete Row', 'Duplicate Row' menu by setting them to false.

      oForm.EnableMenu "1292", False  'AddRow Menu
      oForm.EnableMenu "1293", False  'DeleteRow Menu

    you have the complete list of menu UID in the UI help file.

    You can also create your own menu, that apperas only when the form is open.

    Dim oMenuItem As SAPbouiCOM.MenuItem
    Dim oMenus As SAPbouiCOM.Menus
    Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
    
    oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
    
    oCreationPackage.Checked = False
    oCreationPackage.Enabled = True
    oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
    oCreationPackage.UniqueID = "MyFormMenu1"
    oCreationPackage.String = "MyFormMenu1" oForm.Menu.AddEx(oCreationPackage)
    
    oCreationPackage.Checked = False
    oCreationPackage.Enabled = True
    oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
    oCreationPackage.UniqueID = "MyFormMenu2"
    oCreationPackage.String = "MyFormMenu2"
    oForm.Menu.AddEx(oCreationPackage)

    HTH

    Sebastien

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Mr.Piero,

      Get u got any solution for this question. That is if we want to add or delete the row in matrix based on tat i want to enable or disable the right click menu like delete row or addrow..

      If u have send me some sample code.

      Thanks,

      Regards,

      Anitha

  • author's profile photo
    Former Member
    Posted on Oct 03, 2005 at 05:54 AM

    Sebastien,

    The oForm.EnableMenu is what I am looking for, thanks.

    However, the 'Delete Row' works without writing any codes but, the 'Add Row' is not. Do you have any clue?

    Am I right to say that the event can be captured at MenuEvent?

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      you're right, you need to capture the MenuEvent, and then code the add row. It may be just oMatrix.Addrow, but you'll have to clean the datasource first.

      for the delete, I think you should capture the event too, because you need to delete the data from the database after (if you're not using UDO.)

      HTH

      Sebastien