Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Cannot add Serial/Batch Numbers when i update the Pick List quanity

This is the code when i update the pick list with the quantity.

In this case when i update the exact serial number for the particular pick number this code works.Suppose the client need to change the another serial number this code doesn't work.

Please what are the things that i need to change to update the serial numbers for the pick list.

XmlNodeList elemList = xmlDocument.SelectNodes("PickList/LineNum");

                oPickList.GetByKey(PickListNo);

                int x = 0;

                foreach (XmlNode ele in elemList)

                {

                    XmlAttribute lID = ele.Attributes["LineNum"];

                    if (lID != null)

                    {

                        lineNumber = lID.Value;

                    }

                    oPickList.Lines.SetCurrentLine(Convert.ToInt32(lineNumber));

                    oPickList.Lines.PickedQuantity += Convert.ToDouble(ele.SelectSingleNode("QTP").InnerText);

                    oPickList.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = x;

                    oPickList.Lines.BinAllocations.BinAbsEntry = Convert.ToInt32(ele.SelectSingleNode("BinLocation").InnerText.ToString());

                    oPickList.Lines.BinAllocations.Quantity = Convert.ToDouble(ele.SelectSingleNode("QTP").InnerText);

                    oPickList.Lines.BinAllocations.Add();

                    oPickList.Lines.SerialNumbers.SetCurrentLine(x);

                    oPickList.Lines.SerialNumbers.InternalSerialNumber = ele.SelectSingleNode("ScanSerialNumber").InnerText.ToString();

                    oPickList.Lines.SerialNumbers.Quantity = Convert.ToDouble(ele.SelectSingleNode("QTP").InnerText);

                    oPickList.Lines.SerialNumbers.Add();   

                    x++;

                }

                oPickList.Update();

                ((SAPbobsCOM.Company)HttpContext.Current.Cache[sid]).GetLastError(out iErrorCode, out sErrMsg);

                System.Runtime.InteropServices.Marshal.ReleaseComObject(oPickList);

                oPickList = null;

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question