如何使用C#代码在SAP business one studio 9.2中的“管理”菜单下创建子菜单(文件夹)

问题描述 投票:0回答:1

我是SAP Business one studio的新手,我想在SAP business one Studio中的Administration菜单下创建子菜单(文件夹)

管理 - >附加组件 - >我的插件示例。

c# sap add-on
1个回答
0
投票

您可以使用以下代码在“模块”菜单下添加新菜单...

SAPbouiCOM.Menus oMenus = null;
SAPbouiCOM.MenuItem oMenuItem = null;

//**********************************************************

oMenus = SBO_Application.Menus;
SAPbouiCOM.MenuCreationParams oCreationPackage = null;

//**********************************************************
//Creating a new menu item after the menu whose UID is
//"3328"
//**********************************************************
oCreationPackage = ( ( SAPbouiCOM.MenuCreationParams )( SBO_Application.CreateObject( SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams ) ) );

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

try{
//**********************************************************
//Adding the new menu to the main menu
//**********************************************************

    oMenus.AddEx( oCreationPackage );
    oMenuItem = SBO_Application.Menus.Item( "3328" );

//**********************************************************
//Adding the sub menu of string type to the newly added menu
//**********************************************************

    oMenus = oMenuItem.SubMenus;
    oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
    oCreationPackage.UniqueID = "routesheet";
    oCreationPackage.String = "RouteSheet";

    oMenus.AddEx( oCreationPackage );

}

这是一个示例,我在模块菜单下添加一个名为Route Sheet的新菜单,其UID为43520。

希望它有效。

© www.soinside.com 2019 - 2024. All rights reserved.