on 10-16-2006 1:19 PM
Hi All,
We're attempting to post a journal and the following code is not working... any ideas? The error is <i>[JDT1.Account][line: 1] , 'Tax account has not been defined for the selected tax code'</i>
oJournal = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
oJournal.ReferenceDate = Date.Now
oJournal.DueDate = Date.Now
oJournal.TaxDate = Date.Now
oJournal.Lines.ShortName = "C1000"
oJournal.Lines.Debit = 114
oJournal.Lines.Add()
oJournal.Lines.AccountCode = "00009000"
oJournal.Lines.Credit = 100
oJournal.Lines.Add()
oJournal.Lines.AccountCode = "00009001"
oJournal.Lines.Credit = 14
If oJournal.Add <> 0 Then
MessageBox.Show(oCompany.GetLastErrorDescription)
Else
MessageBox.Show("Added")
End If
Thanks in advance,
Adele
PS: Tested on 2005A SP01 PL09 and PL11
Solved this issue. You need to remove the ReferenceDate and DueDate and then it posts 100%
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adele,
It's cool how you ask and respond yourself ... hehehe
Happy Hacking !
-
-
Alfredo Pérez
SAP Developer & Consultant
alperal (at) gmail.com
+52-(81)-137-937-80
In my case the problem was with the SetCurrentLine method. Here is the code:
-
Set oJE = oSboComp.GetBusinessObjectSAPbobsCOM.BoObjectTypes.oJournalEntries)
oJE.ReferenceDate = DateSerial(2007, 9, 30)
'oJE.Lenes.Add - At the first row do not issue this method!
oJE.Lines.SetCurrentLine 0
oJE.Lines.ShortName = <BP Code>
oJE.Lines.Debit = <Amount>
oJE.Lines.Add 'Now add the 2nd row
oJE.Lines.SetCurrentLine 1
oJE.Lines.AccountCode = <Account Code>
oJE.Lines.Credit = <Amount>
oJE.Add
-
Rgrds,
Jandos
User | Count |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
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.