on 07-29-2014 8:22 PM
Hi Experts.
The code below is returning the error: Internal Erro -5002.
int iCount = oCmp.GetXMLelementCount(@"c:\temp\teste di\ExportImportMode.xml");
oInv = (SAPbobsCOM.Documents)oCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
for (int i = 0; i < iCount; i++)
{
if (oCmp.GetXMLobjectType(@"c:\temp\teste di\ExportImportMode.xml", i) == SAPbobsCOM.BoObjectTypes.oInvoices)
{
oInv = oCmp.GetBusinessObjectFromXML(@"c:\temp\teste di\ExportImportMode.xml", i);
}
}
oInv.DocNum = 0;
if (oInv.Add() != 0) MessageBox.Show(oCmp.GetLastErrorDescription());
The xml used to import was generated starting this code:
oCmp.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode;
oInv = (SAPbobsCOM.Documents)oCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
if (oInv.GetByKey(Convert.ToInt32(txtNumDoc.Text)))
{
oInv.SaveXML(@"c:\temp\teste di\ExportImportMode.xml");
}
xml file is attached.
I am using SAP 9 PL 10.
Hi Brian,
-5002 is an undocumented error code, which means that the structure of the data is incorrect.
By looking at the provided xml file, you have (at least!) to remove all the read-on valuee (DocEntry, DocNum, DocType, etc.).
Regards,
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.