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
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