cancel
Showing results for 
Search instead for 
Did you mean: 

Inventory transfer from multiple warehouses

dilipkumbhar
Participant
0 Kudos

I am using SAP Business One 9.2 PL:08. I have stock in three warehouses i.e. RMLO,CMLO and RMIM. I want to transfer it in RMSRV-NS warehouse. The code is as follows -

Dim objTrans As SAPbobsCOM.StockTransfer

objTrans = objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)
objTrans.Series = intSeries
objTrans.DocDate = objCompany.GetCompanyDate
objTrans.TaxDate = objCompany.GetCompanyDate
objTrans.Reference2 = "SrvId=" & intCallID
objTrans.Comments = "Based on service call id=" & intCallID
objTrans.ToWarehouse = "RMSRV-NS"

For intJ = 0 To strAryWHSE.Length - 1
For intK = 0 To objDT.Rows.Count - 1
strItemCode = objDT.Rows(intK).Item("U_Item_Code")
strQuery = "SELECT COUNT(*) FROM OITW WHERE OnHand>0 AND ItemCode='" & strItemCode & "' AND WhsCode='" & strAryWHSE.GetValue(intJ) & "'"
intCnt = GetDataByScaler(strQuery)
If intCnt > 0 Then
objTrans.Lines.WarehouseCode = "RMSRV-NS"
objTrans.Lines.FromWarehouseCode = strAryWHSE.GetValue(intJ)
objTrans.Lines.ItemCode = strItemCode
objTrans.Lines.Quantity = objDT.Rows(intK).Item("U_Quantity")
objTrans.Lines.Add()
End If
Next
Next
lngStatus = objTrans.Add

How do I specify from warehouse ? While executing above code , I am getting error as,

254009145 - External and non-external warehouses cannot be used for same column

Quantity falls below inventory level

Accepted Solutions (0)

Answers (1)

Answers (1)

dilipkumbhar
Participant
0 Kudos

The second error is ,

Quantity falls into negative inventory [WTR1.ItemCode][line: 1]