on 2008 Jun 19 7:14 AM
hi,
i already created an addon. i want to install that addon under business partner meni item tab. its urgent.
Regards,
Puneeth S
Hi puneeth,
You can create the menu like this :
SAPbouiCOM.Menus oMenus;
SAPbouiCOM.MenuItem oMenusItem;
SAPbouiCOM.MenuCreationParams oCreationPackage = null;
oCreationPackage = ((SAPbouiCOM.MenuCreationParams)(SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)));
oMenusItem = SBO_Application.Menus.Item("43535");
oMenus = oMenusItem.SubMenus;
// Ajout sous-menu "Gestion des affaires"
if (SBO_Application.Menus.Exists("IFC_GEST_AFF") == false)
{
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
oCreationPackage.UniqueID = "IFC_GEST_AFF";
oCreationPackage.String = ChangeLanguage.GetName_For_SubMenu(SBO_Application.Language, "1");
oCreationPackage.Position = 1;
oMenus.AddEx(oCreationPackage);
oCreationPackage = ((SAPbouiCOM.MenuCreationParams)(SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)));
}
This create a entry menu in the Business Partners menu.
If you want to create a entry between Business Partners and Banking with sub menu, try this :
SAPbouiCOM.Menus oMenus;
SAPbouiCOM.MenuItem oMenuItem;
SAPbouiCOM.MenuCreationParams oMenuCreationParams;
string sPath = "";
try
{
sPath = System.Windows.Forms.Application.StartupPath;
oMenuCreationParams = (SAPbouiCOM.MenuCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);
oMenuCreationParams.Type = SAPbouiCOM.BoMenuType.mt_POPUP;
oMenuCreationParams.Image = sPath + "
IMG127 new.BMP";
oMenuCreationParams.Position = 6;
oMenuCreationParams.UniqueID = "IFC_MENU";
oMenuCreationParams.String = "Contrats";
oMenuItem = SBO_Application.Menus.Item("43520");
oMenus = oMenuItem.SubMenus;
if(SBO_Application.Menus.Exists("IFC_MENU") == true)
return;
oMenuItem = oMenus.AddEx(oMenuCreationParams);
System.Runtime.InteropServices.Marshal.ReleaseComObject(oMenuCreationParams);
oMenuCreationParams = null;
oMenuCreationParams = (SAPbouiCOM.MenuCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);
oMenuCreationParams.Type = SAPbouiCOM.BoMenuType.mt_STRING;
oMenuCreationParams.Image = "";
oMenuCreationParams.Position = 1;
oMenuCreationParams.UniqueID = "IFC_CRAU";
oMenuCreationParams.String = "NAME";
oMenus = oMenuItem.SubMenus;
oMenus.AddEx(oMenuCreationParams);
}
catch (Exception ex)
{
// Catch Error
}
Hope i help you
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.