Skip to Content
0
Former Member
Dec 14, 2013 at 03:36 AM

(Urgent ) Inventory tranfer (DI) - Move Bin allowcation with Batch error

481 Views

Hi expert!

I have to use SDK to create Inventory transfer (just move Item with Batch code to other Bins ).

My codes :

.

.....

oTransfer.Lines.ItemCode = StrItemCode

oTransfer.Lines.Quantity = nQty

For i As Integer = 0 To dtItemScan.DefaultView.Count - 1

oTransfer.Lines.FromWarehouseCode = FromWhsCode

oTransfer.Lines.WarehouseCode = ToWhsCode

oTransfer.Lines.BatchNumbers.BatchNumber = dtItemScan.DefaultView(i).Item("BatchCode").ToString

oTransfer.Lines.BatchNumbers.Quantity = nQty

oTransfer.Lines.BatchNumbers.Add()

oTransfer.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batFromWarehouse

oTransfer.Lines.BinAllocations.BinAbsEntry = 2 ' CInt(dtItemScan.DefaultView(i).Item("FromBin").ToString)

oTransfer.Lines.BinAllocations.Quantity = dtItemScan.DefaultView(i).Item("Quantity")

oTransfer.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = i

oTransfer.Lines.BinAllocations.Add()

oTransfer.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batToWarehouse

oTransfer.Lines.BinAllocations.BinAbsEntry = 4 'CInt(dtItemScan.DefaultView(i).Item("ToBin").ToString)

oTransfer.Lines.BinAllocations.Quantity = nQty

oTransfer.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = i

oTransfer.Lines.BinAllocations.Add()

Next

oTransfer.Lines.Add()

'Add the document

RetVal = oTransfer.Add

Error:

-10 1470000838 - Invalid "敓楲污湁䉤瑡档畎扭牥䉳獡䱥湩e"; specify a valid "敓楲污湁䉤瑡档畎扭牥䉳獡䱥湩e"

I have already added Good Receipt PO successfully . But with above codes use for inventory transfer , I can't not. Help me , please!

Thank you!