Hi Bryan,
This is my version in C#
oGT.Lines.ItemCode = ItemCode; oGT.Lines.Quantity = 1; oGT.Lines.FromWarehouseCode =sWhsCode; int iSerialLines = 0; foreach (string Serial in SerialCollection) { oGT.Lines.SerialNumbers.InternalSerialNumber = Serial; //From BIN oGT.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batFromWarehouse; oGT.Lines.BinAllocations.BinAbsEntry = iBinEntry; oGT.Lines.BinAllocations.Quantity = 1; oGT.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = iSerialLines; //The value here must match the LineNo of the Serial //To BIN iBinEntry = (int)oDT.GetValue("TBEN", i); sWhsCode = oDT.GetValue("TWHC", i).ToString(); oGT.Lines.WarehouseCode = sWhsCode; oGT.Lines.BinAllocations.Add(); oGT.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batToWarehouse; oGT.Lines.BinAllocations.BinAbsEntry = iBinEntry; oGT.Lines.BinAllocations.Quantity = 1; oGT.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = iSerialLines; //The value here must match the LineNo of the Serial iSerialLines++; }
When you transfer between BIN, you need to specify both From Bin Information and To Bin Information.
Note the iSerialLines. It must match the LineNum of your Lines.SerialNumbers.
You also need to provide the quantity in the Lines.Quantity.
In My Example above, it is 1 quantity perline.
Generally the sum quantity of these must be equal :
- LINES.QUANTITY
- total of LINES.SERIALNUMBERS
- total of LINES.BINALLOCATION.QUANTITY in the From BIN
- total of LINES.BINALLOCATIONS.QUANTITY in the To BIN.
Regards
Edy