在SAP business one 8.81中的“管理”菜单下创建子菜单(文件夹)

时间:2011-05-11 06:04:40

标签: c# sap

我正在为SAP业务开发一个工资单附加组件8.81。我可以在SAP应用程序附带的最后一个菜单项下面添加菜单,即Reports。我正在尝试在SAP的“管理/设置”菜单下为我的工资单附件添加设置子菜单。

有谁知道怎么做?

以下代码仅显示如何在SAP的“报告”菜单下添加菜单。

它位于c#中,文件名是GUI.cs

oCreationPackage = ((SAPbouiCOM.MenuCreationParams)(app.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)));

                oMenuItem = this.app.Menus.Item("43520");

                string sPath = Application.StartupPath;
                //parent menu
                oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP;
                oCreationPackage.UniqueID = "eim_payroll";
                oCreationPackage.String = "EIM Payroll";
                oCreationPackage.Enabled= true;
                oCreationPackage.Position = 15;
                oCreationPackage.Image = sPath + @"\EIM_Payroll_icon.bmp";

                oMenus = oMenuItem.SubMenus;

                //If the menu already exists this code will fail
                oMenus.AddEx(oCreationPackage);

                //Get the menu collection of the newly added pop-up item
                oMenuItem = this.app.Menus.Item("eim_payroll");
                oMenus = oMenuItem.SubMenus;

                //create the setup menu item for master data
                oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP;
                oCreationPackage.UniqueID = "setup";
                oCreationPackage.String = "Setup";
                oMenus.AddEx(oCreationPackage);

                oMenuItem = this.app.Menus.Item("setup");
                oMenus = oMenuItem.SubMenus;

                //Get the menu collection of the newly added pop-up item
                oMenuItem = this.app.Menus.Item("setup");
                oMenus = oMenuItem.SubMenus;

                //create the payroll menu item for master data
                oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP;
                oCreationPackage.UniqueID = "payroll1";
                oCreationPackage.String = "Payroll";
                oMenus.AddEx(oCreationPackage);

如何在SAP business 1中创建的菜单项中添加子文件夹?

1 个答案:

答案 0 :(得分:1)

刚刚将oMenuItem = this.app.Menus.Item("43530");更改为oMenuItem = this.app.Menus.Item("43525");并且工作正常