Skip to Content
0
Jun 12, 2009 at 08:31 AM

Creating JE problem

14 Views

Hi,

I am posting JE through SDK.

While adding it is showing error as Unbalanced transactions.

If I pass single debit and credit entries it is creating but in my case i have to pass 2 credit and 2 debit entries.

Dim vJE As SAPbobsCOM.JournalEntries

If objMain.objCompany.InTransaction = False Then

objMain.objCompany.StartTransaction()

End If

vJE = objMain.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)

'vJE.UserFields.Fields.Item("U_Branch").Value = Branch

vJE.TaxDate = Now

vJE.DueDate = Now

vJE.Series = Series

vJE.ProjectCode = PrjCode.Trim

vJE.Memo = Remarks

vJE.Lines.AccountCode = DebitorAct.Trim

vJE.Lines.Credit = 0

vJE.Lines.Debit = Amount

vJE.Lines.ProjectCode = PrjCode.Trim

vJE.Lines.CostingCode = Branch.Trim

Call vJE.Lines.Add()

Call vJE.Lines.SetCurrentLine(1)

vJE.Lines.AccountCode = CreditorAct.Trim

vJE.Lines.Credit = Amount

vJE.Lines.Debit = 0

vJE.Lines.ProjectCode = PrjCode.Trim

vJE.Lines.CostingCode = Branch.Trim

Call vJE.Lines.Add()

Call vJE.Lines.SetCurrentLine(1)

vJE.Lines.AccountCode = ServiceAct1.Trim

vJE.Lines.Credit = 0

vJE.Lines.Debit = SvrAmount

vJE.Lines.ProjectCode = PrjCode.Trim

vJE.Lines.CostingCode = Branch.Trim

Call vJE.Lines.Add()

Call vJE.Lines.SetCurrentLine(1)

vJE.Lines.AccountCode = ServiceAct2.Trim

vJE.Lines.Credit = SvrAmount

vJE.Lines.Debit = 0

vJE.Lines.ProjectCode = PrjCode.Trim

vJE.Lines.CostingCode = Branch.Trim

Dim IRetCodeHeader As Integer = vJE.Add()

regards:

SANDY

Edited by: Sandeep Saini | Roorkee | India on Jun 12, 2009 2:25 PM