Skip to Content
0
Mar 08, 2004 at 01:00 PM

DI: GetBusinessObjectFromXML()

165 Views

Hello,

I would like to create a Businesspartner-Object from a XML file. Unfortunately always appear the error -1114. What´s wrong?

Thanks, Stephan

here my VB6 Testprogram:

Sub TestXML()

Dim vCmp As SAPbobsCOM.Company

Dim nResult As Long

Dim strErrString As String

Set vCmp = New SAPbobsCOM.Company

'Initialize the Company Object for the Connect method

vCmp.Server = "(local)"

vCmp.CompanyDB = "SBODemo_DE"

vCmp.UserName = "manager"

vCmp.Password = "manager"

'Connect to the database

nResult = vCmp.Connect

If nResult = 0 Then

Dim vBP As SAPbobsCOM.BusinessPartners

Set vBP = vCmp.GetBusinessObject(oBusinessPartners)

nResult = vBP.GetByKey("C00001")

If nResult <> 0 Then

vBP.SaveXML "C:Test.XML"

Set vBP = vCmp.GetBusinessObjectFromXML("C:TEST.XML", 0)

End If

Set vBP = Nothing

End If

vCmp.Disconnect

Set vCmp = Nothing

end sub