Hi Sriram Try this,
Modify the Test formula like this.
whileprintingrecords;
numbervar test;
numbervar sum_test;
if
(Sum ({@Current_Yr_Debit}, {GL_Transaction_View.ACCOUNT_CODE}) - Sum ({@Current_Yr_Credit}, {GL_Transaction_View.ACCOUNT_CODE})) > 0
then
test := (Sum ({@Current_Yr_Debit}, {GL_Transaction_View.ACCOUNT_CODE}) - Sum ({@Current_Yr_Credit}, {GL_Transaction_View.ACCOUNT_CODE}))
sum_test :=sum_test+test;
test;
Create another formula as below and place in report footer
whileprintingrecords;
numbervar sum_test;
Create same for Test1 also by changing variable names for report footer formula.