Skip to Content
0

Inventory transfer from multiple warehouses

Aug 21, 2017 at 08:31 AM

32

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Dilip Kumbhar Aug 21, 2017 at 08:35 AM
0

The second error is ,

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

Share
10 |10000 characters needed characters left characters exceeded