on 2008 Jun 06 12:05 PM
Dear all,
i tried batch number creation through DIAPI.. but its shows error message [WTR1.Whscode][Line:1],'No matching Records found(ODBC-2028)' any body helpme in this regard..
thanks in advance.. here i have attached my coding..
Dim objLines As SAPbobsCOM.StockTransfer_Lines
objForm = objAddOn.objApplication.Forms.Item(FormUID)
Dim objStockTransfer As SAPbobsCOM.StockTransfer
objStockTransfer = objAddOn.objCompany.GetBusinessObjectSAPbobsCOM.BoObjectTypes.oStockTransfer)
objStockTransfer.DocDate = System.DateTime.Today
objStockTransfer.TaxDate = System.DateTime.Today
objStockTransfer.FromWarehouse = "01"
objStockTransfer.PriceList = 1
objStockTransfer.Lines.ItemCode = "B000001"
objStockTransfer.Lines.Quantity = "1"
objStockTransfer.Lines.WarehouseCode = "BAP"
objStockTransfer.Lines.BatchNumbers.BatchNumber = "B10"
objStockTransfer.Lines.BatchNumbers.Quantity = "1"
objStockTransfer.Lines.BatchNumbers.Add()
If objStockTransfer.Add <> 0 Then
objAddOn.objApplication.SetStatusBarMessage(objAddOn.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, True)
objAddOn.objApplication.MessageBox(objAddOn.objCompany.GetLastErrorDescription)
Else
objAddOn.objApplication.SetStatusBarMessage("Inventory Transfered Successfully", SAPbouiCOM.BoMessageTime.bmt_Short, False)
End If
With Regards
G.shankar Ganesh
Shankar,
your code looks fine. just ensure that the warehouse code and batch you are specifying , do exist in owhs and oibt tables respectively, with the specified quantity. ( and the best way to check it is, try stock transfer from UI with the same parameters.)
also, may be off topic, but, before specifying batch lines, you need to ensure that items are managed by batch or not )
regards,
Binita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi binitha,
i got the solution.. thank you.. i have given wrong batch number.. now the problem is solved
with Regards
G.shankar Ganesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think that you have in
objStockTransfer.Lines.WarehouseCode = "BAP"
warehouse name and not code. Try to change it to code and it should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what i don't like is that you use
objStockTransfer.Lines.BatchNumbers.Add()
after setting the line. this can result in an empty line!
also i don't see objStockTransfer.Lines.BatchNumbers.SetCurrentLine
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
111 | |
8 | |
8 | |
6 | |
6 | |
5 | |
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.