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

Adding new Batch Number to StockTransfer

Hi experts.

i have a problem when try add a new StockTransfer document. the error is "480000112 - Batch/serial number 3006 1000902 selected on row 1 does not exist; specify a valid batch/serial number." i think , the problem is that I don't have created the batchs becouse my items are managed by "On Release Only" and "Batches". how can i create new batches when add new Stocktransfer?

Please Help me!!!

my code

 
                sap.StockAdjustment.DocDate = Date.Today()
                sap.StockAdjustment.FromWarehouse = ReceiptMessage.Depot(x)
                sap.StockAdjustment.Comments = "Transfer from PO " & ReceiptMessage.ClientOrderReference(x)
                sap.StockAdjustment.FromWarehouse = "02"

                For i = 0 To lines.CountLines(x) - 1
                    sap.StockAdjustment.Lines.ItemCode = lines.ArticleID.Item(i)
                    sap.StockAdjustment.Lines.Quantity = lines.QuantityValue.QuantityValue.Item(i)
                    sap.StockAdjustment.Lines.BatchNumbers.SetCurrentLine(0)
                    sap.StockAdjustment.Lines.BatchNumbers.Location = aduana ' variable
                    sap.StockAdjustment.Lines.BatchNumbers.BatchNumber = pedimento ' variable
                    sap.StockAdjustment.Lines.BatchNumbers.Quantity = lines.QuantityValue.QuantityValue.Item(i) ' quantity
                    sap.StockAdjustment.Lines.BatchNumbers.AddmisionDate = fechapedimento ' date
                    sap.StockAdjustment.Lines.BatchNumbers.Add()
               next i
                  Dim ReturnTrans As String = sap.StockAdjustment.Add()
                  If ReturnTrans <> 0 Then
                    sap.oCompany.GetLastError(ReturnTrans, sErrs)             
                Else

                End If


Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 08, 2011 at 07:52 PM

    Hi,

    Welcome you post on the forum.

    You may check:

    batches-on-release-only

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2011 at 04:22 AM

    hi create new batch for that item

    Inventory ->Item Management --->Choose Batch Management -


    >

    First You change Operation is Completed and select the particular item for From and To.

    Update the Batch. after you posting the stock transfer in manually in SAP Business One. Its working.

    and also write the query for select the batch numbers for that item and added Code itself to assign. remove setcurrentline(0)

    Thanks & Regards

    B.Lakshmi Narayanan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2011 at 09:05 AM

    hi what is the status for this thread. if problem solved marked answered

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2011 at 05:27 PM

    Since you can not create BatchsNumbers by DIAPI, you have to create BatchNumbers from SAP, and then assign them with code

    thanks to all

    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.