SAP B1 Inventory Counting : Getting error as Internal error (-5002) Occurred

448 Views Asked by At

We are implementing inventory counting service in our application & we are making calls using DIAPI. When we perform the add operation on inventory counting we are getting an error:

Internal error (-5002) occurred

We are using SAP B1 V10 with respective DIAPI. We able to connect to the SAP B1 instance/server using DIAPI but when performing add we are getting error.

Here is the sample code for add:

SAPbobsCOM.Company _company = new SAPbobsCOM.Company();

_company.Server = @"ServerURL";

_company.CompanyDB = "CompanyDatabase";

_company.UserName = "username";

_company.Password = "password";

_company.LicenseServer = "licenseServer";

_company.language = (SAPbobsCOM.BoSuppLangs)

Enum.Parse(typeof(SAPbobsCOM.BoSuppLangs), "ln_English_Gb");

_company.DbServerType = (SAPbobsCOM.BoDataServerTypes)

Enum.Parse(typeof(SAPbobsCOM.BoDataServerTypes), "15");

_company.DbUserName = "DBUser";

_company.DbPassword = "DBPassword";

int returnVal = _company.Connect();

SAPbobsCOM.CompanyService oCS = (SAPbobsCOM.CompanyService)_company.GetCompanyService();

SAPbobsCOM.InventoryCountingsService oICS = oCS.GetBusinessService(SAPbobsCOM.ServiceTypes.InventoryCountingsService);

SAPbobsCOM.InventoryCounting oIC = oICS.GetDataInterface(SAPbobsCOM.InventoryCountingsServiceDataInterfaces.icsInventoryCounting);

oIC.FromXMLFile("c:\\Temp\\UserXML.xml");

SAPbobsCOM.InventoryCountingParams oInventoryCountingParams = oICS.Add(oIC);
0

There are 0 best solutions below