0

I enabled some menu in right click event. The first time it works well. For example 'Add Row' menu is pressed, it adds row. Again I right click button, and it's not showing the menus which I enabled in right click event. I need to add row again and again.

How can I achieve this?

Private Sub SBO_Application_RightClickEvent(ByRef eventInfo As SAPbouiCOM.ContextMenuInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.RightClickEvent
    Try
        oForm = SBO_Application.Forms.Item("TRADING")
        If (eventInfo.FormUID = "TRADING") Then
             oCombo = oForm.Items.Item("1000002").Specific
            Dim oMenus As SAPbouiCOM.Menus
            oMenus = SBO_Application.Menus
            oForm.EnableMenu("1287", True)
            oForm.EnableMenu("1292", True)
            oForm.EnableMenu("1293", True)
           If (oCombo.Selected.Value = "Open") Then
                oMenus.Item("1283").Enabled = True
            Else
                oMenus.Item("1283").Enabled = False
            End If

        End If
    Catch ex As Exception

    End Try

End Sub
J. Steen
  • 15,470
  • 15
  • 56
  • 63

1 Answers1

0

based on the input that u gave with your post, there may be two chance of getting error.

  1. for the first time u are adding the row perfectly but in next time it was not working.. so i think code was not perfectly handled. try to place the same code in before action false. and also try to catch the action result that u get at item event so that we can debug the issue clearly.
  2. to enable the right click event menu we need to handle the right click menu options based on oform.mode Separately.

for example in purchase order screen we will get different menu in add more and find mode.

Rajmohan
  • 46
  • 2