cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new Batch Number to StockTransfer

Former Member
0 Kudos

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


Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

thanks to all

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Welcome you post on the forum.

You may check:

Thanks,

Gordon