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

XMLread Function

Hi EveryOne:

has any Body tried the function XMLread???.

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

Dim ret As Long

Dim FileName As String

Dim Ecount As Long

Dim ii As Long

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

'Get the number of Business object in the file ...

Ecount = oCompany.GetXMLelementCount(FileName)

'Loop threw the objects and when finding the first

'BusinessPartner object , load it and stop.

For ii = 0 To Ecount - 1

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

'Read the Business object data

Set vBP = oCompany.GetBusinessObjectFromXML(FileName, ii)

Exit For

End If

Next ii

ret = vBP.Add

If ret = 0 Then

MsgBox "Document No: " & lDocNum & " successfully added, Create Sales Order"

End If

End Function

I have created an XML file of Business Partner, and I want to post the data in SBO, but I always get an error:

ret=-1

Has any one tried it??.

Thanks to all

Bye

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

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

    I havnt tried it, and neither has anyone else, because we dont have the C1212.XML document :o)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 16, 2004 at 08:36 PM

    When you get the error, you should check the error text as well. You can retrieve it with

    oCompany.GetLastError lErrCode, sErrMsg

    You might want to step through the code to be sure that a business partner was found in the file as well, and to check the properties of vBP before you attempt the add.

    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.