Skip to Content
0
Former Member
Nov 04, 2009 at 04:19 AM

Problem with inventory entry multiple lines

14 Views

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