on 04-24-2006 9:09 AM
Hi all,
Does anyone know why this code would throw the "- 5002 Invalid total [OINV.Address]" error? Any ideas?
Here is my code, and datas:
[code]Dim ReturnValue As Long
Dim ErrCode As Long
Dim ErrMsg$ = ""
Dim vInvoice As SAPbobsCOM.Documents
Dim iLine As Long
vInvoice = vCompany.GetBusinessObject(MyObjectType)
'MyObjectType = 13
vInvoice.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
vInvoice.CardCode = MyCardCode$
'MyCardCode = Is an existing BP's code
vInvoice.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO
vInvoice.DocDueDate = MyDocDueDate
'MyDocDueDate = #5/9/2006#
vInvoice.DocDate = MyDocDate
'MyDocDate = #5/9/2006#
vInvoice.TaxDate = MyDocDate
'MyDocDate = #5/9/2006#
vInvoice.VatDate = MyDocDate
'MyDocDate = #5/9/2006#
For iLine = 1 To MyLineNr
If iLine > 1 Then
vInvoice.Lines.Add()
End If
vInvoice.Lines.ItemCode = MyItemCode$(iLine - 1)
'MyItemCode = Is an existing item code
vInvoice.Lines.Quantity = MyQuatity(iLine - 1)
'MyQuantity 1 = 1
'MyQuantity 2 = 1
vInvoice.Lines.Price = MyPrice(iLine - 1)
'MyPrice 1 = -100
'MyPrice 2 = 300
vInvoice.Lines.VatGroup = MyVatGroup$(iLine - 1)
'MyVatGroup = Is an existing VAT group
Next iLine
ReturnValue = vInvoice.Add
[/code]
Thanks the help.
Hi,
I have had some problems in the past with casesensitivity of the cardcode. Could it be that the cardcode differs by case?
Regards,
Jacco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What's the value of MyLineNr?
Regards,
Jacco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.