Skip to Content

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

Addings Goods Receipt PO + Serial Number + Bin Allocation

Hey Guys, I want to add a Goods Receeeipt PO, I have 1 lines with 20 items and 20 serial numbers.

Nos for the BinAllocation I can only assign 1 SerialAndBatchNumbersBaseLine, so I'm adding multiple lines with quantity 1 and each one assigning to a differente SerialAndBatchNumbersBaseLine but I get the following error: 1470000307 - Duplicate bin locations have been removed.

Any recommendation of what is the right way to do this?

error3.jpg (48087 B)
Tags:
Former Member
replied

Hi Youval,

you are missing myLines.BinAllocations.Add() .

I reproduced your scenario and the following is working :

SAPbobsCOM.Documents oDoc = SBO_Company.GetBusinessObject(BoObjectTypes.oOrders);

                    oDoc.GetByKey(383);

                    oDoc.Lines.SerialNumbers.ManufacturerSerialNumber = "st1";

                    oDoc.Lines.SerialNumbers.InternalSerialNumber = "st1";

                    oDoc.Lines.SerialNumbers.Quantity = 1;

                    oDoc.Lines.SerialNumbers.Add();

                    oDoc.Lines.SerialNumbers.ManufacturerSerialNumber = "st2";

                    oDoc.Lines.SerialNumbers.InternalSerialNumber = "st2";

                    oDoc.Lines.SerialNumbers.Quantity = 1;

                    oDoc.Lines.SerialNumbers.Add();

                    oDoc.Lines.SerialNumbers.ManufacturerSerialNumber = "st3";

                    oDoc.Lines.SerialNumbers.InternalSerialNumber = "st3";

                    oDoc.Lines.SerialNumbers.Quantity = 1;

                    oDoc.Lines.SerialNumbers.Add();

                    oDoc.Lines.SerialNumbers.ManufacturerSerialNumber = "st4";

                    oDoc.Lines.SerialNumbers.InternalSerialNumber = "st4";

                    oDoc.Lines.SerialNumbers.Quantity = 1;

                    oDoc.Lines.SerialNumbers.Add();

                    oDoc.Lines.SerialNumbers.ManufacturerSerialNumber = "st5";

                    oDoc.Lines.SerialNumbers.InternalSerialNumber = "st5";

                    oDoc.Lines.SerialNumbers.Quantity = 1;

                   

                    oDoc.Lines.BinAllocations.BinAbsEntry = 1;

                    oDoc.Lines.BinAllocations.Quantity = 1;

                    oDoc.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;

                    oDoc.Lines.BinAllocations.BaseLineNumber = 0;

                    oDoc.Lines.BinAllocations.Add();

                    oDoc.Lines.BinAllocations.BinAbsEntry = 1;

                    oDoc.Lines.BinAllocations.Quantity = 1;

                    oDoc.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 1;

                    oDoc.Lines.BinAllocations.BaseLineNumber = 0;

                    oDoc.Lines.BinAllocations.Add();

                    oDoc.Lines.BinAllocations.BinAbsEntry = 1;

                    oDoc.Lines.BinAllocations.Quantity = 1;

                    oDoc.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 2;

                    oDoc.Lines.BinAllocations.BaseLineNumber = 0;

                    oDoc.Lines.BinAllocations.Add();

                    oDoc.Lines.BinAllocations.BinAbsEntry = 1;

                    oDoc.Lines.BinAllocations.Quantity = 1;

                    oDoc.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 3;

                    oDoc.Lines.BinAllocations.BaseLineNumber = 0;

                    oDoc.Lines.BinAllocations.Add();

                    oDoc.Lines.BinAllocations.BinAbsEntry = 1;

                    oDoc.Lines.BinAllocations.Quantity = 1;

                    oDoc.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 4;

                    oDoc.Lines.BinAllocations.BaseLineNumber = 0;

                    if (oDoc.Update() != 0)

                        MessageBox.Show("Error " + SBO_Company.GetLastErrorDescription());

                    else

                        MessageBox.Show("Success");

regards,

Maik

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question