Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to add Sub-Menu option

Hi

  I have created Menu like this . I want Sub-Options to be created under Maintain Transactions.

Dim oMenus As SAPbouiCOM.Menus

        Dim oMenuItem As SAPbouiCOM.MenuItem

        oMenus = SBO_Application.Menus

        Dim oCreationPackage As SAPbouiCOM.MenuCreationParams

        oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)

        oMenuItem = SBO_Application.Menus.Item("43520")

  • oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP

        oCreationPackage.UniqueID = "MyMenu"

        oCreationPackage.String = "My Module"

        oCreationPackage.Enabled = True

        oCreationPackage.Position = 15

        oMenus = oMenuItem.SubMenus

        Try ' If the manu already exists this code will fail

            oMenus.AddEx(oCreationPackage)

            oMenuItem = SBO_Application.Menus.Item("MyMenu")

            oMenus = oMenuItem.SubMenus

            oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

            oCreationPackage.UniqueID = "MySubMenu"

            oCreationPackage.String = "Maintain Master"

            oMenus.AddEx(oCreationPackage)

            oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

            oCreationPackage.UniqueID = "MySubMenu0"

            oCreationPackage.String = "Maintain Transactions"

            oMenus.AddEx(oCreationPackage)

        Catch er As Exception

        End Try

Thanks

Former Member
Not what you were looking for? View more on this topic or Ask a question