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