on 2005 Jul 25 11:26 AM
I do this:
If (BoJV Is Nothing) Then
Set BoJV = Company.GetBusinessObject(oJournalVouchers)
End If
With BoJV.JournalEntries
.SetCurrentLine (0)
.Lines.Add
.Lines.AccountCode = "61200001"
Calculos
.Lines.Debit = Debito
.Lines.Add
.Lines.AccountCode = AccountCode
.Lines.Credit = Credito
.Lines.Add
Res=.Add
End With
When doing .Add, variable Res get the value=0, but when i go to see the results in SAP, no new journal vouchers are created. Where can be the problem? I've read that journalvocheurs.JournalEntries.lines.ShortName is a mandatory field, but i don't know where to get this value and if it can be the problem, but SAP doesn't gives me any error, the result of add is OK(0) and i don't use this suppossed mandatory field.
Thanks!
Hi Natalia,
1.If the vouchers are not added - SBO will return a n error code. You can "catch" by using Company.GetLastError (if the error code returned after the .Add function call is not = 0).
2. Try this:
- Don't set the current line when you are adding (by default SBO does it for you).
-use the lines .Add function only after the 1st journal line e.g.
If (BoJV Is Nothing) Then
Set BoJV = Company.GetBusinessObject(oJournalVouchers)
ELSE
Set BoJV = nothing
Set BoJV = Company.GetBusinessObject(oJournalVouchers)
End If
With BoJV.JournalEntries
.Lines.AccountCode = "61200001"
Calculos
.Lines.Debit = Debito
.Lines.Add
.Lines.AccountCode = AccountCode
.Lines.Credit = Credito
Res=.Add
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
106 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.