on 11-08-2011 4:23 PM
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
Since you can not create BatchsNumbers by DIAPI, you have to create BatchNumbers from SAP, and then assign them with code
thanks to all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi what is the status for this thread. if problem solved marked answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.