cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member807459
Discoverer
0 Kudos
354

Hi Experts!

For one of our project requirement, 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 as:

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);

Please suggest a solution for this error. Thank you in advance!

Accepted Solutions (0)

Answers (0)