Skip to Content

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

"Invalid Index -1105" when adding AR Invoice using SDK


I am trying to add an A/R Invoice using SDK by using the OInvoice object but when adding the invoice its generating an error "Invalid Index -1105"

Here the code am using:

Private Sub AddOrderToDatabase()

Dim iError, iCount As Integer

Dim sErrMsg As String

Dim oInv As SAPbobsCOM.Documents

oInv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)

Dim oBob As SAPbobsCOM.SBObob

oInv.CardCode = "ACC001-C"

oInv.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO

oInv.DocDate = "#9/9/2008#"

oInv.DocDueDate = "#9/9/2008#"

oInv.DocCurrency = "USD"

oInv.Lines.ItemCode = "test001"

oInv.Lines.ItemDescription = "test"

oInv.Lines.Quantity = 1

oInv.Lines.UnitPrice = 10

oInv.Lines.VatGroup = "O1"


lretcode = oInv.Add

If lretcode <> 0 Then

oCompany.GetLastError(iError, sErrMsg)

MessageBox.Show(iError & " " & sErrMsg, "Import Error", MessageBoxButtons.OK, MessageBoxIcon.Error)


MessageBox.Show("imported successfully.", "Import", MessageBoxButtons.OK, MessageBoxIcon.Information)

End If

End Sub

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