Skip to Content

DI Inventory Transfer

Dear Experts,

I have a problem when I want to create DI Inventory transfer. Below is the detail about what I face:

In this case, RM warehouse has 1 bin location (BIN001),

BIN001 has 2 batch as below :

BATCH01 -- 1500 boxes

BATCH02 -- 1000 boxes

For example, I have item A which will be transfered from RM warehouse to PRD warehouse with quantity 2000 boxes.

Based on the information above, the stock which should be transfered from RM warehouse is as below :

BIN001 BATCH01 -- 1500 boxes

BIN001 BATCH02 -- 500 boxes.

The things that I want is it can automatically calculate and choose which BIN and BATCH should be taken for this inventory transfer.

I have created some code to solve this DI but I got a problem about the looping process to check which BIN I should take.

Please put any comment and suggestion about my below code and thank you for the help.

Dim oOWTR As SAPbobsCOM.StockTransfer

oOWTR = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)

Dim SBO As SBOAdapter

Dim tgadapter As New TransferGudangAdapter

oOWTR.DocDate = DateTime.Now

oOWTR.FromWarehouse = "RM"

oOWTR.ToWarehouse = "PRD"

oOWTR.Comments = "RM to PRD"

oOWTR.JournalMemo = "Inventory Transfer - " & ID

For Each WOR1 In t_tit

v_transIT = tgadapter.get_vIT2(WOR1.Itemcode, WOR1.Bin, ID).First

oOWTR.Lines.ItemCode = WOR1.Itemcode

oOWTR.Lines.FromWarehouseCode = "RM"

oOWTR.Lines.WarehouseCode = "PRD"

oOWTR.Lines.Quantity = v_transIT.qty

Dim qtytemp As Integer

Dim onhandqtytemp As Integer

Dim v_transIT3 As String

qtytemp = WOR1.Qty

onhandqtytemp = v_transIT.onhandqty

oOWTR.Lines.BatchNumbers.SetCurrentLine(0)

oOWTR.Lines.BatchNumbers.BatchNumber = v_transIT.batchabsentry

oOWTR.Lines.BatchNumbers.Quantity = v_transIT.qty

oOWTR.Lines.BatchNumbers.Add()

oOWTR.Lines.BinAllocations.SetCurrentLine(0)

oOWTR.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0

oOWTR.Lines.BinAllocations.BinActionType = 2

oOWTR.Lines.BinAllocations.BinAbsEntry = v_transIT.binabs

oOWTR.Lines.BinAllocations.Quantity = v_transIT.qty

oOWTR.Lines.BinAllocations.Add()

oOWTR.Lines.Add()

Next

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 19, 2016 at 11:00 AM

    Hi Marini,

    The determination of which batch and bin can be easily retrieved using SQL Query if you know the priority of the picking. ie From which bin should it take first, and in this Bin, which batch ordering should be taken first.

    The complexity of the query will depends on your SQL Server version.

    On SQL Server 2012, this is just a simple query.

    Check on the table OBBQ for Batch and OSBQ for Serials.

    Regards

    Edy

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.