on 05-05-2006 3:13 PM
Hello. Porbably a noob question, but, here we go.
I need to add a menu in "modules" menu, but in a specific place.
Under Production > Production Reports menu @@
Someone can help me?
The code that you will need is :
SAPbouiCOM.MenuItem oMenuItem;
oMenus = oapplication.Menus;
SAPbouiCOM.MenuCreationParams menucreat;
menucreat = ((SAPbouiCOM.MenuCreationParams)(oapplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)));
oMenuItem = oapplication.Menus.Item ("2048");
// The 2048 is the menu-itemcode for sales. For production menu.. you need to doa savexml for the menu in SBO.. And it will give you a number... I will try to get that xml.. So it will be more clear
string spath = string.Empty;
spath = Application.StartupPath;
menucreat.Type = SAPbouiCOM.BoMenuType.mt_STRING;
menucreat.UniqueID = "XMLload01";
menucreat.String = "VCADDON";
menucreat.Enabled = true;
menucreat.Position = 12;
oMenus.AddEx(menucreat);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the reply, but what i mean is to create inside production/production reports menu @@.
Is that possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fernando,
What Sébastian has showed you will still work perfectly, but you have to change the menu number you are going to post to. If you enable the System Information under the view menu, you'll be able to look at the menu number in the status bar as you hover over the menu (from the main menu drop downs, not the command center) you'll see that the Production Reports menu is 43542. You just replace the number in Sébastian's example with this number.
Hope it helps,
Adele
Yes off course
UID of menu "Production Report" is 43542
just use the code below, but change 43520 by this number
You can find the list of menu uid in the help.
Sebastien
'******************************
Hopefully it's friday, I start to be really long to write a post, Week-end is soon!!!...
Thanks Adele.
Message was edited by: Sébastien Danober
Hello
You can use the position property of the oCreationPackage function
Dim oMenuItem As SAPbouiCOM.MenuItem
Dim oMenus As SAPbouiCOM.Menus
Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
oMenuItem = SBO_Application.Menus.Item("43520") // moudles menu
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "MyMenu01"
oCreationPackage.String = "Sample Menu"
oCreationPackage.Enabled = True
oCreationPackage.Image = "UI.bmp"
'*****************************************
<b> oCreationPackage.Position = 9</b>
'*****************************************
oMenus = oMenuItem.SubMenus
// Add the menu to the SBO application
oMenus.AddEx(oCreationPackage)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.