on 10-03-2008 12:24 PM
Hi
I create a menu and assign 9 forms its ok but when i execute the programme first all are open after 1 0r 2 mins no one form is open .What is the problem?Is there any time out?And I write the SaveAsXML as follow I thing it is 100% wrong .PLease tell How can it write
Private Sub SaveAsXML(ByRef Form As SAPbouiCOM.Form)
' Dim oXmlDoc As Xml.XmlDocument
' Dim sXmlString As String
' oXmlDoc = New Xml.XmlDocument
' sXmlString = Form.GetAsXML
' oXmlDoc.LoadXml(sXmlString)
' Dim sPath As String
' sPath = IO.Directory.GetParent(Application.StartupPath).ToString
' oXmlDoc.Save((sPath & "\dispensing.srf"))
' oXmlDoc.Save((sPath & "\sizing.srf"))
' oXmlDoc.Save((sPath & "\poweblending.srf"))
' oXmlDoc.Save((sPath & "\granulation.srf"))
' oXmlDoc.Save((sPath & "\Drying.srf"))
' oXmlDoc.Save((sPath & "\Tabletcompression.srf"))
' oXmlDoc.Save((sPath & "\Cleaning.srf"))
' oXmlDoc.Save((sPath & "\Inprocess.srf"))
' oXmlDoc.Save((sPath & "\Finalproducttest.srf"))
It's because your form is opened.
Try to debug loading of your form with this method:
So you change UniqueID of the opening form.
But, you also need to close it with oForm.Close() method.
Private Sub ReplaceUIDLoadToSBO(ByRef FileName As String, ByVal sFormUID As String)
Const XML_FormUIDPath As String = "Application/forms/action/form/@uid"
Dim oXmlDoc As Xml.XmlDocument
Dim oNode As Xml.XmlNode
Try
oXmlDoc = New Xml.XmlDocument
Dim sPath As String
sPath = IO.Directory.GetParent(Application.StartupPath).ToString
oXmlDoc.Load(sPath & "\" & FileName)
'// Find and Change the UID dymamically
oNode = oXmlDoc.DocumentElement.SelectSingleNode(XML_FormUIDPath)
oXmlDoc.SelectSingleNode(XML_FormUIDPath).Value = sFormUID
'// Save the changed xml data to verify the new Form UID
Dim sPath As String = System.Environment.GetEnvironmentVariable("TEMP")
oXmlDoc.Save(sPath & "\" & sFormUID & ".xml")
'// Load the xml into de Form
SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
End Sub
Edited by: Sierdna S on Oct 3, 2008 1:39 PM
Edited by: Sierdna S on Oct 3, 2008 4:37 PM
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
Hi...
use this code it will work
Private Sub AddMenuItem()
Try
Dim oMenuItem As SAPbouiCOM.MenuItem
Dim oMenus As SAPbouiCOM.Menus
Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
oMenuItem = SBO_Application.Menus.Item("2304") Rem under purchase module
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
If SBO_Application.Menus.Exists("MenuID") Then
SBO_Application.Menus.RemoveEx("MenuID")
End If
oCreationPackage.UniqueID = "SubMenu"
oCreationPackage.String = "SubMenu Name"
oCreationPackage.Enabled = True
oCreationPackage.Checked = True
oCreationPackage.Position = 0
oMenus = oMenuItem.SubMenus
oMenus.AddEx(oCreationPackage)
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
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.
User | Count |
---|---|
69 | |
14 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.