cancel
Showing results for 
Search instead for 
Did you mean: 

Inventory On Hand not updated after goods receipt

Former Member
0 Kudos

Dear all,

I made a test program with the purpose of Goods receipt and update OnHand quantity of given Item on

designated warehouse; the result is -- Goods receipt created succefully, but Onhand qty not updated,

My code is as follow (in VB6), would greate appreciated on your big help:

Dim oDoc As SAPbobsCOM.Documents

Dim Flag, Err1 As Integer

Set oDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)

oDoc.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Service

'create the receipt from production

'on the basis of production order just created

oDoc.DocDate = Now

oDoc.Lines.ItemCode = "1234567_89ABCDXYZ"

oDoc.Lines.AccountCode = "715001"

oDoc.Lines.Quantity = 98

oDoc.Lines.Price = 24

oDoc.Lines.WarehouseCode = "P01"

oDoc.Lines.BatchNumbers.BatchNumber = "C01"

oDoc.Lines.BatchNumbers.Quantity = 98

oDoc.Lines.BatchNumbers.SetCurrentLine (0)

Flag = oDoc.Add()

If Flag <> 0 Then

oCompany.GetLastError lErrCode, sErrMsg

MsgBox lErrCode & " " & sErrMsg

End If

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The problem is in line

oDoc.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Service

Service type document doesnt change the quantity on stock.