cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Auto Journal Voucher With Automatic Tax Option Through Code

Former Member
0 Kudos

Hello All,

I am trying to create a Jounal Voucher through code with Tax Code Values in the rows and using Automatic Tax CAlculation

But while running the code System is giving the error Message as [ Location is Missing [ JDT1.SequenceNr ][ Line : 3 ] ]

Code through which i am generating the JV is as follows :-

Dim JE As SAPbobsCOM.JournalEntries

JE = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)

Dim oBob As SAPbobsCOM.SBObob

JE.LocationCode = 1

JE.AutoVAT = SAPbobsCOM.BoYesNoEnum.tYES

'--- First Line of Jv For Debit -


'

JE.Lines.AccountCode = "103000"

JE.Lines.Debit = 104

JE.Lines.Credit = 0

JE.Lines.TaxCode = "Service"

JE.Lines.TaxPostAccount = SAPbobsCOM.BoTaxPostAccEnum.tpa_SalesTaxAccount

Call JE.Lines.Add()

Call JE.Lines.SetCurrentLine(1)

'===== Second Line For Credit ===='

JE.Lines.AccountCode = "101000"

JE.Lines.Debit = 0

JE.Lines.Credit = 100

lRetCode = JE.Add

If lRetCode <> 0 Then

ocompany.GetLastError(lErrCode, sErrMsg)

If (lErrCode <> -4006) Then

SBO_Application.MessageBox(sErrMsg)

End If

End If

Please suggest what changes i have to make in the code to create the JV with automatic Tax calculations .

Thanks & Regards,

Amit

Edited by: AmitSharma_061985 on Feb 26, 2010 8:42 AM

Edited by: AmitSharma_061985 on Feb 26, 2010 8:43 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello

This code generates Journal Entry not Journal Voucher.

You wish to Generate Journal Voucher, Use JournalVouchers Object then JE.

Regards,

J

Former Member
0 Kudos

Hello Janos,

I want to create a Journal Entry through this code not Journal Voucher .

Thanks

Amit

Answers (1)

Answers (1)

Former Member
0 Kudos

k