Skip to Content
0
Former Member
Apr 21, 2005 at 08:59 AM

Error creating an AP Invoice

49 Views

Hi,

I am trying to create an AP invoice(Doc Type = Service) using DI API.I am getting the following eror message:

[OPCH.GrosProfit][line: 1] , 'No matching records found (ODBC -2028)'

My code is as follows:

-


Set oCmp = New SAPbobsCOM.Company

oCmp.UseTrusted = True

oCmp.Server = "(local)"

oCmp.CompanyDB = "ABC-Holding"

oCmp.UserName = "manager"

oCmp.Password = "manager"

oCmp.Language = SAPbobsCOM.BoSuppLangs.ln_English

l = oCmp.Connect()

Set oApInvoice = oCmp.GetBusinessObject(oPurchaseInvoices)

oApInvoice.DocType = dDocument_Service

oApInvoice.CardCode = "VA001S"

oApInvoice.Lines.ItemDescription = "Banana"

oApInvoice.Lines.Price = 2.36

oApInvoice.Lines.AccountCode = "999999-100"

RetVal = oApInvoice.Add

If RetVal <> 0 Then

oCmp.GetLastError ErrCode, ErrMsg

MsgBox ErrCode & " " & ErrMsg

End If

-


Please help.

Thanks.