Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Inventory On Hand not updated after goods receipt

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

Former Member
Not what you were looking for? View more on this topic or Ask a question