cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with inventory entry multiple lines

Former Member
0 Kudos

Hello experts.

i have a problem. When I want import inventory entries with sdk.(the sample code here). this code function when import one or two lines for document realy function, but when i agree more that this("comment code"). the document not created

Thank You.

Dim Doc_H As SAPbobsCOM.Documents

Dim Doc_Lines As SAPbobsCOM.Document_Lines

Set Doc_H = sboCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)

Set Doc_Lines = Doc_H.Lines

Doc_H.Reference2 = "1"

Doc_H.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items

Doc_Lines.SetCurrentLine (0)

Doc_Lines.WarehouseCode = "01"

Doc_Lines.ItemCode = "a1"

Doc_Lines.Quantity = 5

Doc_Lines.UnitPrice = 100

Doc_Lines.Add

Doc_Lines.SetCurrentLine (1)

Doc_Lines.WarehouseCode = "02"

Doc_Lines.ItemCode = "a3"

Doc_Lines.Quantity = 10

Doc_Lines.UnitPrice = 102

' Doc_Lines.Add

' Doc_Lines.SetCurrentLine (2)

' Doc_Lines.WarehouseCode = "03"

' Doc_Lines.ItemCode = "a2"

' Doc_Lines.Quantity = 2

' Doc_Lines.UnitPrice = 105

Dim Error As Long

Error = Doc_H.Add

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

Warehouse and itemcodes are exists in the database?

Please provide your error message for understanding the problem

Regards,

J.

former_member682029
Contributor
0 Kudos

What is the actual error?

And check that the values you entered in the commented code is not existing in the company.