Skip to Content

Inventory transfer from multiple warehouses

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 21, 2017 at 08:35 AM

    The second error is ,

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

    Add comment
    10|10000 characters needed characters exceeded