cancel
Showing results for 
Search instead for 
Did you mean: 

About the balance calculation using subroutine in forms

Former Member
0 Kudos

Hello all,

this is regarding calling the subroutine in the script.

I have a field balance carried amount with name SALDO and a filed with name WRSHB(may be either credit or debit).

Everytime i have to calculate the balance amount depending upon the credit and debit amount.

on first iteration, carried amount+credit = B1.

on second iteration , B2 = B1+debit .

on third iteration, B3 = B2 + Credit.

So on.....

but in this carried amount field,SALDO is unique on first iteration and later it will not be in the scope of balance calculation.

i.e first time i have to calculate the balance amount from SALDO and credit amount and from next time onwards i have to calculate the balance from the balance that i got in the previous step and then add that to credit or debit amount.

How can i approach this using subroutine.

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Can you check B1 for the first time it would be blank so if it is blank so if that is blank use the carried amount fromt eh second time onwards there would be some value in B1 then do not use it.

So pass the values of carried amount and the other two fields and inside the subroutine check if the B1 amount is blank if it is blank add the value of carried amount other wise do not.

Regards,

Himanshu

Former Member
0 Kudos

Hi,

You pass outstanding amt after each pass into a variable v_bal and calculate balance :

v_bal = v_bal + v_amt.

Clear that v_bal for every new customer/vendor.

Thanks and Regards,

Chandra