on 10-07-2008 8:09 AM
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
Hi,
i also think the mistake is in your code,
feel free to post your code here and we analyze it
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.