cancel
Showing results for 
Search instead for 
Did you mean: 

DI - Export BusinessPartners to XML

Former Member
0 Kudos

Hi,

I want to export all BusinessPartners.

To export just one, I use (VB.Net)

ConnectToCompany()

Dim oBP As SAPbobsCOM.BusinessPartners

oBP = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)

oRecordSet.DoQuery("Select cardcode from ocrd where cardtype = 'C'")

oBP.Browser.Recordset = oRecordSet

oCompany.XmlExportType() = SAPbobsCOM.BoXmlExportTypes.xet_NodesAsProperties

oBP.SaveXML("C:\Program Files\SAP Manage\XML\" & "databrowserNAP" & ".xml")

but, how to export all?

Could someone help me?

Thanks,

Laurent

View Entire Topic
FOA
Advisor
Advisor
0 Kudos

Hi Laurent, you have to use the SaveXML method of the Recordset Object. You can use the SBObob object as well.

Here an example:

'// Get an initialized SBObob object

oSBObob = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)

'// Get an initialized Recordset object

oRecordSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

'// Execute the SBObob GetBPList method

oRecordSet = oSBObob.GetBPList(SAPbobsCOM.BoCardTypes.cCustomer)

'// the RecorSet now contains a list of Keys of the Requested Type

' If oRecordSet.RecordCount > 0 Then

Dim sPath As String

sPath = Application.StartupPath

oRecordSet.SaveXML(sPath & "BP_list.xml")

'End If

Best regards,

Felipe