on 10-07-2008 12:39 PM
Hi
I am develpoping an application in which in contains a folder a six form i am working with all at a time.
earlier i worked with single form.
now here are 6 forms now how to write
SBO_Application_MenuEvent
for the forms
how to write code for selecting add mode find modes can you get me any solution plz.
Thanks Regarding
mahi.
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.
Thank You very much i have created the forms and working with them what i need is how to write code at
Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
If (pVal.MenuUID = "1282") And (pVal.BeforeAction = False) Then '1282 for Add Mode
oForm = SBO_Application.Forms.Item("TBL_QPLAN_")
'oForm.Select()
getNextDocNum()
oItem = oForm.Items.Item("MATRIX")
oMatrix = oItem.Specific
oColumns = oMatrix.Columns
oMatrix.AddRow()
End If
how to select different forms for add and find modes..
Thanks regarding.
User | Count |
---|---|
102 | |
12 | |
11 | |
6 | |
5 | |
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.