Skip to Content
author's profile photo Former Member
Former Member

Orders Documents

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.


Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 22, 2004 at 03:52 PM


    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.


    Ibai Peñ

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Jul 13, 2004 at 10:24 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.