cancel
Showing results for 
Search instead for 
Did you mean: 

Folder

Former Member
0 Kudos

Hi to All

I create a folder under production menu and in that folder i add the 7 sub menu items.so its not working properly.But when i delete the 7th sub menu item then it work properly.What is the problem?

Is there any condition One menu having not more than 6 Menu item?

With Regards,

M.Thippa Reddy

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

Hi,

i also think the mistake is in your code,

feel free to post your code here and we analyze it

lg David

Former Member
0 Kudos

try to adjust the 7 items from and to pane similarly to that of the folders from pane and to pane

Rgds

Micheal

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi...

use this code....

Private Sub AddMenuItem()

Dim oMenuItem As SAPbouiCOM.MenuItem

Dim oMenus As SAPbouiCOM.Menus

Dim oCreationPackage As SAPbouiCOM.MenuCreationParams

Dim sPath As String

sPath = System.Windows.Forms.Application.StartupPath()

sPath = sPath.Remove(sPath.Length - 3, 3)

oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)

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

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP

If SBO_Application.Menus.Exists("aaa") Then

SBO_Application.Menus.RemoveEx("aaa")

End If

oCreationPackage.UniqueID = "aaa"

oCreationPackage.String = "Module Name(Menu)"

oCreationPackage.Image = "C:\Program Files\SAP\SAP Business One\AddOns\Foldername\xxxx.bmp"

oCreationPackage.Enabled = True

oCreationPackage.Checked = True

oCreationPackage.Position = 14

oMenus = oMenuItem.SubMenus

Try

oMenus.AddEx(oCreationPackage)

oMenuItem = SBO_Application.Menus.Item("aaa")

oMenus = oMenuItem.SubMenus

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "bbb"

oCreationPackage.String = " Form1"

oMenus.AddEx(oCreationPackage)

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "ccc"

oCreationPackage.String = "Form2"

oMenus.AddEx(oCreationPackage)

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "ddd"

oCreationPackage.String = "Form3"

oMenus.AddEx(oCreationPackage)

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "eee"

oCreationPackage.String = "Form4"

oMenus.AddEx(oCreationPackage)

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "ffff"

oCreationPackage.String = "form5"

oMenus.AddEx(oCreationPackage)

Catch er As Exception

SBO_Application.MessageBox("Menu Already Exists")

End Try

End Sub

Regards..

Billa 2007

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

There is not a constraint that a menu should have less than 7 sub menu items. You may check the 7th menu item's UID, position etc. There should be something wrong with it.

Kind Regards

-Yatsea