cancel
Showing results for 
Search instead for 
Did you mean: 

How to select the batch number in a stock transfer

Former Member
0 Kudos

Hi all,

I need to add a stock transfer for a batched item.

I used the DI object StockTransfer and StockTransfer_lines to add a stock transfer. However, the property StockTransfer_Lines.BatchNumbers does not seem to work (documentation says it is a read-only property). How can I specify the batch number for the stock transfer? Attached is my VB source code.

regards,

LuanBoo

Set mobjStockTr = SBO_Company.GetBusinessObject(oStockTransfer)

With mobjStockTr

.FromWarehouse = "01"

End With

Set mobjStockTr_Lines = mobjStockTr.Lines

With mobjStockTr_Lines

.Add

.ItemCode = "B10"

.Quantity = 1

.WarehouseCode = "02"

End With

Set mobjBatchNo = mobjStockTr_Lines.BatchNumbers

With mobjBatchNo

.BatchNumber = "555"

.Quantity = 1

End With

nReturn = mobjStockTr.Add

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I have got the same problem too.

I have to write a VB .NET program to retrieve a Stock Transfer Transaction and create another Stock Transfer Transaction accordingly.

Does anyone can help?

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I have created an stock transfer document referencing a BatchNumber withtou problem.

I think you forgot to call the Add() on the BatchNumbers collection...

Here you have the code I use:

Dim st As SAPbobsCOM.StockTransfer

st = pCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)

st.CardCode = "Partner01"

st.Lines.ItemCode = "Item01"

st.Lines.Quantity = 1

st.Lines.WarehouseCode = "03"

st.Lines.BatchNumbers.BatchNumber = "01"

st.Lines.BatchNumbers.Quantity = 1

st.Lines.BatchNumbers.Add()

st.Lines.Add()

iResult = st.Add()

Please let me know if it works for you.

Regards

Trinidad.

Answers (0)