Skip to Content
author's profile photo Former Member
Former Member

Batch Number creation through DIAPI

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2008 at 11:51 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 06, 2008 at 11:54 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2008 at 11:55 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2008 at 01:31 PM

    Hi binitha,

    i got the solution.. thank you.. i have given wrong batch number.. now the problem is solved

    with Regards

    G.shankar Ganesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.