Hi
C#
_oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode;
_oCompany.XMLAsString = false;
string xmlSchema = _oCompany.GetBusinessObjectXmlSchema(SAPbobsCOM.BoObjectTypes.oBusinessPartners);
System.IO.File.WriteAllText("D:\\TEMP\\bp.xml", xmlSchema);Thanks

Amit MohantyRank #112 · 20K reputationPosted Dec 30, 2023, 12:45 AM EST
You should ensure that the directory "D:\TEMP\" exists on your system before attempting to write the file to it. You can create the directory manually or modify your code to create the directory if it doesn't exist before writing the file.
_oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode; _oCompany.XMLAsString = false; string xmlSchema = _oCompany.GetBusinessObjectXmlSchema(SAPbobsCOM.BoObjectTypes.oBusinessPartners); string directoryPath = @"D:\TEMP\"; if (!System.IO.Directory.Exists(directoryPath)) { System.IO.Directory.CreateDirectory(directoryPath); } System.IO.File.WriteAllText(directoryPath + "bp.xml", xmlSchema);