on 04-21-2005 9:59 AM
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.
Hello,
I think you must use this sentence to add the line before adding the invoice:
oApInvoice.Lines.Add
But DI has a problem when you use that method. You have to set another line after calling the add method. Then setting another line this way:
oApInvoice.Lines.ItemDescription = "Banana 2"
oApInvoice.Lines.Price = 2.40
oApInvoice.Lines.AccountCode = "999999-100"
Don't forget to set the taxCode in Both lines and after that you can add the Invoice:
RetVal = oApInvoice.Add
I hope i could help you..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think you'll need to setup the itemcode for every line which is added to your document.
Try to add the following code for every line you would like to add:
oAPInvoice.Lines.ItemCode = "Your ItemCode"
Furthermore you have to add the line to the document after you setup the properties. You do this with the following command:
oAPInvoice.Lines.Add()
I hope this helps you fixing your problem.
Regards
Dennis Karjetta
Message was edited by: Dennis Karjetta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am having the same problem. I am setting the taxcode. Satish Dwevedi did you get this working?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
Try setting the taxcode on the invoice line.
Lita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.