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!