on 12-30-2005 4:02 AM
Hi gurus,
If I remember right, a standard form (ex:A/R invoice, A/P invoice ...) in the SBO system, we can ganerate to XML file. But I don't remember how to do it, anybody know about it, pls help me, tell me ... pls. Thanks.
Hello Andy,
The answer of your question could be found in SAP samples, UI API sample 4.(default path C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB6\04.WorkingWithXML)
The code is below.
There are lots of samples delivered with SDK, and I think you would benefit a lot from them.
HTH,
Nick
Private Sub SaveAsXML(Form As SAPbouiCOM.Form)
'// Add a reference to "Microsoft XML, v3.0"
Dim oXMLDoc As MSXML2.DOMDocument
Dim sXMLString As String
Set oXMLDoc = New MSXML2.DOMDocument
'// get the form as an XML string
sXMLString = Form.GetAsXML
'// load the form's XML string to the
'// XML document object
oXMLDoc.loadXML (sXMLString)
'// save the XML Document
Dim sPath As String
sPath = CurDir
oXMLDoc.save (sPath & "MySimpleForm.xml")
End Sub
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andy
Most Business Objects on the header have the property SAVEXML. So just do your object declaring, use getby key to get the exact document/record and the savexml to get it to xml. The below is all you need to make an xml file for an invoice with the doc number 3141.
Dim oInvoice As SAPbobsCOM.Documents
oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
If oInvoice.GetByKey("3141") Then oInvoice.SaveXML("c:\Test.xml")
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just some points that I have noticed on using the SaveXML by use of business objects... If you go through a business objects SaveXML / SaveToFile methods it will only save the FIRST returned dataset... So for example if you use the Production Order business object you will only get back the first (or first Queried) row of data from the OWOR table and the related data in the WOR1 table... If you want all the data from both tables you will need to use a Recordset object and query all the required data from the tables that you want then save the recordset to a XML file...
User | Count |
---|---|
107 | |
12 | |
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.