on 07-04-2014 9:56 AM
Dear All,
How can i add menu like this:
Sales-A/R
Sub1
Sub1.1
Sub1.2
Sub2
Sub2.1
Sub2.2
Sub2.3
Anybody know how i can do by using UI API?
Thanks
TONY
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
in XML:
<?xml version="1.0" encoding="utf-16"?>
<Application>
<Menus>
<action type="add">
<Menu String="Header" Enabled="1" Position="14" Checked="0" FatherUID="2048" Image="" Type="2" UniqueID="LEV1">
<Menus>
<action type="add">
<Menu String="SubHeader1" Enabled="1" Position="1" Checked="0" FatherUID="LEV1" Type="2" UniqueID="LEV21">
<Menus>
<action type="add">
<Menu String="Chil1" Enabled="1" Position="1" Checked="0" FatherUID="LEV21" Type="1" UniqueID="Child1"/>
<Menu String="Chil2" Enabled="1" Position="2" Checked="0" FatherUID="LEV21" Type="1" UniqueID="Child2"/>
</action>
</Menus>
</Menu>
<Menu String="SubHeader2" Enabled="1" Position="2" Checked="0" FatherUID="LEV1" Type="2" UniqueID="LEV22">
<Menus>
<action type="add">
<Menu String="Child3" Enabled="1" Position="1" Checked="0" FatherUID="LEV22" Type="1" UniqueID="Child3"/>
<Menu String="Child4" Enabled="1" Position="2" Checked="0" FatherUID="LEV22" Type="1" UniqueID="Child4"/>
</action>
</Menus>
</Menu>
</action>
</Menus>
</Menu>
</action>
</Menus>
</Application>
in SDK you can follow $riniva$ Rachumallu
Private Sub AddMenuItems()
Dim oMenus As SAPbouiCOM.Menus
Dim oMenuItem As SAPbouiCOM.MenuItem
Dim i As Integer '// to be used as counter
Dim lAddAfter As Integer
Dim sXML As String
oMenus = SBO_Application.Menus
Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
oMenuItem = SBO_Application.Menus.Item("43520") 'moudles'
Dim sPath As String
sPath = Application.StartupPath
sPath = sPath.Remove(sPath.Length - 3, 3)
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "Heading"
oCreationPackage.String = "Heading"
oCreationPackage.Enabled = True
oCreationPackage.Image = sPath & "gear_icon_b.bmp"
oCreationPackage.Position = 14
oMenus = oMenuItem.SubMenus
Try ' If the manu already exists this code will fail
oMenus.AddEx(oCreationPackage)
'// Get the menu collection of the newly added pop-up item
oMenuItem = SBO_Application.Menus.Item("Heading")
oMenus = oMenuItem.SubMenus
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "SubHeading"
oCreationPackage.String = "SubHeading"
oCreationPackage.Position = "0"
oMenus = oMenuItem.SubMenus
oMenus.AddEx(oCreationPackage)
oMenuItem = SBO_Application.Menus.Item("SubHeading")
oMenus = oMenuItem.SubMenus
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "SubSubHeading"
oCreationPackage.String = "SubSubHeading"
oCreationPackage.Position = "1"
oMenus = oMenuItem.SubMenus
oMenus.AddEx(oCreationPackage)
' ''**************************Adding Menu Items for Ho to Remy ********************
oMenuItem = SBO_Application.Menus.Item("SubSubHeading")
oMenus = oMenuItem.SubMenus
'// Create s sub menu
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
oCreationPackage.UniqueID = "GIss"
oCreationPackage.String = "Form1"
oCreationPackage.Position = "0"
oMenus.AddEx(oCreationPackage)
'// Create s sub menu
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
oCreationPackage.UniqueID = "GRec"
oCreationPackage.String = "Form1"
oCreationPackage.Position = "1"
oMenus.AddEx(oCreationPackage)
Catch er As Exception ' Menu already exists
' SBO_Application.MessageBox("Menu Already Exists")
End Try
Try
'oMenuItem = SBO_Application.Menus.Item("11520") 'moudles'
'oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
'oCreationPackage.UniqueID = "IMas"
'oCreationPackage.String = "Reusable ItemMaster"
'oCreationPackage.Enabled = True
'' oCreationPackage.Image = sPath & "UI.bmp"
'oCreationPackage.Position = 3
'oMenus = oMenuItem.SubMenus
'' If the manu already exists this code will fail
'oMenus.AddEx(oCreationPackage)
Catch ex As Exception
End Try
End Sub
Thanks & Regards,
silambu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.