cancel
Showing results for 
Search instead for 
Did you mean: 

Creating menu with group folder

Former Member
0 Kudos
217

Hi !

I already have my addon menu working but i want to create a sub menu (group) like the one with the folder icon in SBO main menu. Ex:

Addon Menu (in main menu pop-up)

Utilities (sub menu with a folder design besides it)

Add

Remove

Report

All my sub menus are individually listed under Addon Menu ... what would be the code to group them under utilies under Addon Menu ????

Thanks..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Alain,

You must create a Menu object then assign the submenu with a specific type. Type mt_popup mean will create a submenu which can carry another submenu. Type mt_string means will create a submenu which can clicked to display the form you've created.

Ex.

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP

oCreationPackage.UniqueID = "MyMenu01"

oCreationPackage.String = "Sample Menu"

oCreationPackage.Enabled = True

oCreationPackage.Image = sPath & "UI.bmp"

oCreationPackage.Position = 15

' If the menu already exists this code will fail

On Error GoTo AddMenuItemsErr

oMenuItem.SubMenus.AddEx oCreationPackage

'// Get the menu collection of the newly added pop-up item

Set oMenuItem = SBO_Application.Menus.Item("MyMenu01")

'// Create s sub menu

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "MySubMenu"

oCreationPackage.String = "Sample Sub Menu"

oMenuItem.SubMenus.AddEx oCreationPackage

Hope this will help.

Former Member
0 Kudos

That code is waht i have presently in my addon ... It makes a popup menu with all the submenues under.

I would like all my sub menus to be part of a group called utilities .

So i would click on my addon menu in SBO then i would see my normal submenus + a group sub menu (Utilities) that when i click on it shows more submenus...

Thanks...

Former Member
0 Kudos

I use XML and LoadBatchActions for menus as I find it much easier to edit. A simple example producing a structure such as:-

My Addon
- Addon Program 1
- Addon Program 2
- Utilites
  - Add
  - Remove
  - Report

can be achieved by:-

<?xml version="1.0" encoding="UTF-16"?>
<Application>
    <Menus>
        <action type="add">
            <Menu Checked="0" Enabled="1" FatherUID="43520" Image="MyPicture.bmp" Position="12" String="My Addon" Type="2" UniqueID="AZU_ADD" />
            <Menu Checked="0" Enabled="1" FatherUID="AZU_ADD" Image="" Position="1" String="Addon Program 1" Type="1" UniqueID="AZU_ADD1" />
            <Menu Checked="0" Enabled="1" FatherUID="AZU_ADD" Image="" Position="2" String="Addon Program 2" Type="1" UniqueID="AZU_ADD2" />
            <Menu Checked="0" Enabled="1" FatherUID="AZU_ADD" Image="" Position="3" String="Utilities" Type="2" UniqueID="AZU_ADD_UT" />
            <Menu Checked="0" Enabled="1" FatherUID="AZU_ADD_UT" Image="" Position="1" String="Add" Type="1" UniqueID="AZU_UT1" />
            <Menu Checked="0" Enabled="1" FatherUID="AZU_ADD_UT" Image="" Position="2" String="Remove" Type="1" UniqueID="AZU_UT2" />
            <Menu Checked="0" Enabled="1" FatherUID="AZU_ADD_UT" Image="" Position="3" String="Report" Type="1" UniqueID="AZU_UT3" />
        </action>
    </Menus>
</Application>

Is this what you want to produce?

John.

Former Member
0 Kudos

Yes its what i want... ill try to put it in code ... instead of xml...

Thanks...

Cant click on reply in the forum.... hope you got the points

Answers (0)