on 08-04-2005 12:17 PM
Hi, all.
During addition to the menu (SAP BO 6.5) I get an error:
<Menu - not found>
Sample code here:
Dim oMenu As SAPbouiCOM.Menus
Set oMenu = oSBOApp.sboApp.Menus(4).SubMenus 'a problem is here
If anybody know what a reason for this error?
Tnx.
Dim sboGuiApi As SAPbouiCOM.sboGuiApi
Dim oMenu As SAPbouiCOM.Menus
Dim oMenuItem As SAPbouiCOM.MenuItem
Set sboGuiApi = New SAPbouiCOM.sboGuiApi
sboGuiApi.Connect stConnectionString
Set sboApp = sboGuiApi.GetApplication
Set sboGuiApi = Nothing
Set oMenu = oSBOApp.sboApp.Menus(4).SubMenus 'here error
Set oMenuItem = oMenu.Add("[UNIQUE_NAME]", "[CAPTION_STRING]", mt_POPUP, 0)
variable sboApp declared in module as public WithEvents.
Tnx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dim oMenus As SAPbouiCOM.Menus
Dim oMenu As SAPbouiCOM.MenuItem
'Get the menus collection from the application
Set oMenus = SBO_Application.Menus
' Point on the module sub menu
Set oMenu = SBO_Application.Menus.Item("43520")
Set oMenus = oMenuItem.SubMenus
Set oMenu = oMenus.Item("4")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used this code - way back in 6.5
Dim oMenus As SAPbouiCOM.Menus
Dim oMenuItem As SAPbouiCOM.MenuItem
' Get the menus collection from the application
Set oMenus = SBOUIApp.Menus
' Find the place in wich to add the Pop Up Menu
Set oMenuItem = oMenus.Item("43520") 'Modules
Set oMenus = oMenuItem.SubMenus
' Check if the menu Item exists
If Not oMenus.Exists("Video Store") Then
' Add the menu collection of submenus
Set oMenuItem = oMenus.Add("Video Store", "Video Store", mt_POPUP, oMenus.Count)
'Add the sub menus
Set oMenuItem = oMenus.Item("Video Store")
Set oMenus = oMenuItem.SubMenus
Set oMenuItem = oMenus.Add("Movies On Shelf", "Movies On Shelf", mt_STRING, oMenus.Count)
Set oMenuItem = oMenus.Add("Movie Location", "Movie Location", mt_STRING, oMenus.Count)
Set oMenuItem = oMenus.Add("Add Movie", "Add Movie", mt_STRING, oMenus.Count)
Set oMenuItem = oMenus.Add("Rent/Return Movie", "Rent/Return Movie", mt_STRING, oMenus.Count)
Tnx, Barend.
But I'm repeat:
this code
Set oMenuItem = oMenus.Item("43520") 'Modules
correct only for SAP 2004.
In any case, I'm think that I found the solution.
I'm just separate next cod to 2 rows.
was:
Set oMenu = Set oMenu = oSBOApp.sboApp.Menus(4).SubMenus
and now it look like this:
Set oMenu = oSBOApp.sboApp.Menus(4)
Set oSubMenu = oMenu.SubMenus
tnx to all.
With best regards.
Spart
Could u give us more code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
could you show us more code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
9 | |
8 | |
5 | |
4 | |
3 | |
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.