on 08-21-2017 9:31 AM
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
The second error is ,
Quantity falls into negative inventory [WTR1.ItemCode][line: 1]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.