on 01-07-2015 3:29 PM
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?
Hi Youval,
Can you post your existing code ?
If it is 20 items with 1 Serial each, the Bin.SerialAndBatchNumberBaseLine should always be 0.
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this example I have ItemCode "MyItem" with 5 serial numbers, all of them going to the same bin location.
Document_Lines myLines = myDoc.Lines;
//Item Data
myLines.ItemCode = "MyItem";
myLines.Quantity = 5;
//Serial Number Data
myLines.SerialNumbers.ManufacturerSerialNumber = "X00001";
myLines.SerialNumbers.Add();
myLines.SerialNumbers.ManufacturerSerialNumber = "X00002";
myLines.SerialNumbers.Add();
myLines.SerialNumbers.ManufacturerSerialNumber = "X00003";
myLines.SerialNumbers.Add();
myLines.SerialNumbers.ManufacturerSerialNumber = "X00004";
myLines.SerialNumbers.Add();
myLines.SerialNumbers.ManufacturerSerialNumber = "X00005";
//Bin Location Data
myLines.BinAllocations.BinAbsEntry = 345;
myLines.BinAllocations.Quantity = 1;
myLines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
myLines.BinAllocations.BinAbsEntry = 345;
myLines.BinAllocations.Quantity = 1;
myLines.BinAllocations.SerialAndBatchNumbersBaseLine = 1;
myLines.BinAllocations.BinAbsEntry = 345;
myLines.BinAllocations.Quantity = 1;
myLines.BinAllocations.SerialAndBatchNumbersBaseLine = 2;
myLines.BinAllocations.BinAbsEntry = 345;
myLines.BinAllocations.Quantity = 1;
myLines.BinAllocations.SerialAndBatchNumbersBaseLine = 3;
myLines.BinAllocations.BinAbsEntry = 345;
myLines.BinAllocations.Quantity = 1;
myLines.BinAllocations.SerialAndBatchNumbersBaseLine = 4;
myDoc.Add();
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
User | Count |
---|---|
99 | |
9 | |
9 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.