cancel
Showing results for 
Search instead for 
Did you mean: 

Inventory Counting with Serial Number

Former Member
0 Kudos

Hi everyone.

I'm using B1 9.1 PL13.

I'm trying to create a Inventory Counting document with Serial number by DIAPI.

The problem is. There is an item with no quantity available in B1. But I'm try to set quantity 1 in Inventory Counting document, with a Serial Number that already exist in B1.

But all the time i get an error saying "The item xxxx with serial number xxxx does not exist in waherehouse."

Anyone can help me?

former_member185682
Active Contributor

Hi Eduardo,

Use the primary tag as SAP Business One SDK to get more answers, and if possible, share your code.

Kind Regards,

Diego Lother

Former Member
0 Kudos

Thanks Diego for the tip...

Former Member
0 Kudos

Here is the part of the code where i set the serial number.

//Get the SysSerial from the SAP

dsSerialNumber = dataAccess.B1Data.getOleDbData("select top 1 isnull(SysSerial, 0) SysSerial from OSRI where SuppSerial = '" + produto.Serie + "' and itemcode = '" + produto.ProdutoCodigo + "' order by InDate desc");

//Add new Line Serial

newInventarioLineSerie = newInventarioLine.InventoryCountingSerialNumbers.Add();

//Set the exist SysSerial

newInventarioLineSerie.SystemSerialNumber = dsSerialNumber.Tables[0].Rows.Count > 0 ? Convert.ToInt32(dsSerialNumber.Tables[0].Rows[0]["SysSerial"].ToString()) : 0;

//Set ManufacturerSerialNumber

newInventarioLineSerie.ManufacturerSerialNumber = produto.Serie;

//Set Internal Serial Number

newInventarioLineSerie.InternalSerialNumber = produto.Serie;

//Set the quantity

newInventarioLineSerie.Quantity = Convert.ToDouble(produto.Quantidade, new System.Globalization.CultureInfo("en-US"));

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member587655
Discoverer
0 Kudos

hi all,

anyone have solution for this case ?

i am using SAP B1 9.3 PL4 HANA, and still can not update serial number that already exists.

please help.

former_member185682
Active Contributor
0 Kudos

Hi Eduardo,

I try to reproduce your scenario, and got the same situation. My sample code:

                CompanyService oCS = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService();
                InventoryCountingsService oICS = oCS.GetBusinessService(SAPbobsCOM.ServiceTypes.InventoryCountingsService);
                InventoryCounting oIC = oICS.GetDataInterface(SAPbobsCOM.InventoryCountingsServiceDataInterfaces.icsInventoryCounting);
                DateTime dt = DateTime.Now;
                oIC.CountDate = DateTime.Now;
                oIC.BranchID = 1;
                InventoryCountingLines oICLS = oIC.InventoryCountingLines;
                InventoryCountingLine oICL = oICLS.Add();
                oICL.ItemCode = "AA1CP6410-A0106";
                oICL.CountedQuantity = 1;
                oICL.WarehouseCode = "001.01";
                oICL.Counted = SAPbobsCOM.BoYesNoEnum.tYES;
                InventoryCountingSerialNumber oICLserial = oICL.InventoryCountingSerialNumbers.Add();
                //oICLserial.InternalSerialNumber = "Teste 1234";
                oICLserial.SystemSerialNumber = 1;
                //oICLserial.ManufacturerSerialNumber = "Teste 1234";
                oICLserial.Quantity = 1;


                SAPbobsCOM.InventoryCountingParams oICP = oICS.Add(oIC);

I saw that if I need to do the same action on SAP Business One Client I need to click on Create button on select serial numbers screen.

Maybe something missed on this functionality on SDK.

If you get no answers, I suggest you to try open a ticket on SAP support to discover if this is a bug or system design.

Hope it helps.

Kind Regards,

Diego Lother

Former Member
0 Kudos

Thanks Diego. I'll try to figure out what's going on. I've tried many ways to do it works but without success until now.