Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to create folder

HI,

How to create folder in Menu

Like In Production Menu we have productionReport.How is it possible?Using Vb.Net

Former Member
Former Member replied

Hi,

As complement of Vitor said, you can create your menu like 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.BMP";

oMenuCreationParams.Position = 6;

oMenuCreationParams.UniqueID = "IFC_MENU_COM";

oMenuCreationParams.String = ChangeLanguage.GetName_For_Menu(SBO_Application.Language); ;

oMenuItem = SBO_Application.Menus.Item("43520");

oMenus = oMenuItem.SubMenus;

if(SBO_Application.Menus.Exists("IFC_MENU_COM") == 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_COM";

oMenuCreationParams.String = ChangeLanguage.GetName_For_SubMenu(SBO_Application.Language, "1");

oMenus = oMenuItem.SubMenus;

oMenus.AddEx(oMenuCreationParams);

oMenuCreationParams = (SAPbouiCOM.MenuCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);

oMenuCreationParams.Type = SAPbouiCOM.BoMenuType.mt_STRING;

oMenuCreationParams.Image = "";

oMenuCreationParams.Position = 2;

oMenuCreationParams.UniqueID = "IFC_CALC";

oMenuCreationParams.String = ChangeLanguage.GetName_For_SubMenu(SBO_Application.Language, "2");

oMenus.AddEx(oMenuCreationParams);

oMenuCreationParams = (SAPbouiCOM.MenuCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);

oMenuCreationParams.Type = SAPbouiCOM.BoMenuType.mt_STRING;

oMenuCreationParams.Image = "";

oMenuCreationParams.Position = 3;

oMenuCreationParams.UniqueID = "IFC_BULL";

oMenuCreationParams.String = ChangeLanguage.GetName_For_SubMenu(SBO_Application.Language, "3");

oMenus.AddEx(oMenuCreationParams);

}

Hope it's help you.

Regards

Michael

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question