cancel
Showing results for 
Search instead for 
Did you mean: 

Orders Documents

Former Member
0 Kudos

Hi I am using the function XMLRead...

When I create a business Partner with this method I don't have any problem, This function reads the XMl and then I add it to SBO.

The problem comes when I try to Read An XML of an Order.

Private Function XMLRead(oCompany As SAPbobsCOM.Company, vBP As SAPbobsCOM.Documents)

Dim ret As Long

Dim FileName As String

Dim Ecount As Long

Dim ii As Long

Dim i As Long

Set vBP = oCompany.GetBusinessObject(oOrders)

FileName = "C:\Archivos de programa\SAP Manage\XML\13.xml"

Ecount = oCompany.GetXMLelementCount(FileName)

For ii = 0 To Ecount - 1

If oCompany.GetXMLobjectType(FileName, ii) = oOrders Then

'Read the Business object data

Set vBP = oCompany.GetBusinessObjectFromXML(FileName, ii)

Exit For

End If

Next ii

ret = vBP.Add

*****

I recieve an error telling me that the XML is not valid, but I am sure that I have creates de XML Correctly.

has any one used this method to create an order.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If it says the XML is invalid then there is probably something wrong with it. (whatever it is)

You can always check out if it has syntax problems by starting the xml document with Internet Exploder. It will tell you if there is an error in the XML.

Former Member
0 Kudos

Buenas,

Where does exactly give the error?

Which is the xml format? Did you create it using SaveXML method?

Give us some more information. I don´t see any mistake in the code.

Regards,

Ibai Peñ

Former Member
0 Kudos

Hola Ibai:

The error gives me exactly at the line....

Ecount = oCompany.GetXMLelementCount(FileName)

And I generate the XML file with SaveXML

Call vDoc.SaveXML("C:\Archivos de programa\SAP Manage\XML\" + Str(vDoc.DocNum) + ".xml")

I U want I can send u The XML file if u give my ur email.

Thank's for Ur reply.

see u