Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Open

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"))

replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question