Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded