cancel
Showing results for 
Search instead for 
Did you mean: 

How to add Sub-Menu option

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sunny,

For this make 'Maintain Transaction' of mt_POPUP type.

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP

            oCreationPackage.UniqueID = "MySubMenu0"

            oCreationPackage.String = "Maintain Transactions"



Then add submenus under 'Maintain Transaction' using Unique ID of 'Maintain Transaction'




Hope it helps.




Thanks & Regards


Ankit Chauhan