cancel
Showing results for 
Search instead for 
Did you mean: 

Create Sub Menu

Former Member
0 Kudos

Hi Dear;

how can i create submenu under sales A/R.

How can i know the menu id for each menu

thank you Dear;

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Dim oMenus As SAPbouiCOM.Menus ' The menus collection

Dim oMenuItem As SAPbouiCOM.MenuItem ' The new Menu item

' Get the menus collection from the application

oMenus = SBO_Application.Menus

Dim oCreationPackage As SAPbouiCOM.MenuCreationParams

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

oMenuItem = SBO_Application.Menus.Item("2048") ' Sales A/R menu ID

oMenus = oMenuItem.SubMenus

' New menu parameters

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "xxxxx"

oCreationPackage.String = "New Menu"

oCreationPackage.Enabled = True

oCreationPackage.Position = 15 'what ever position u need

Try ' If the manu already exists this code will fail

oMenus.AddEx(oCreationPackage)

Catch er As Exception ' Menu already exists

SBO_Application.MessageBox("Menu Already Exists")

End Try

Regards,

varma

Answers (1)

Answers (1)

Former Member
0 Kudos

Dany ,

Try this,

U create one xml file and write this code...

<?xml version="1.0" encoding="utf-8" ?>

<Application>

<Menus>

<action type="add">

<Menu String="Purchase Indent" Enabled="1" Position="0" Checked="0" FatherUID="2304" Type="1" UniqueID="PI" />

</action>

</Menus>

</Application>

String is the caption of ur submenu

Position is here u have to locate(if Sales A/R is in 3rd u give 4 for position)

FatherUid is the id of which mainmenu that u can identify by click view --> System information --> then u drag near sales the id will be displayed in status bar.

Uniqueid is the ur form id

Call this xml in sub main

If it helps give reward points,

Regards,

Anitha