Skip to Content

B1 UI API, how to use menu event to add row in matrix

Hi All,

In a Add-on, If I want to add rows to matrix, can i use the right click menu to do it?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 08 at 09:44 AM

    Hi Fung, Jian Feng Huang,

    Yes, you can do it. This can be done as below:

    if (pVal.ItemUID == enControlName.Matrix && pVal.FormMode != 0 && pVal.EventType == SAPbouiCOM.BoEventTypes.et_CLICK && (pVal.ColUID == "col_f"))
    {
        SelectedRow = pVal.Row;
        oForm.EnableMenu("1292", true);
        oForm.EnableMenu("1293", true);
    }
    

    Then, under the Menu Event you can add a new row to the matrix once the menu "1292" is selected.

    if (pVal.MenuUID == "1292")
    {
    	oMatrix.AddRow();
    }
    

    Hope it helps!

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded