Skip to Content
0
Former Member
Feb 07, 2012 at 10:35 AM

Script Logic

15 Views

Hi Experts,

I written a script to calculate the closing balance of a flow for all the accounts which has account type AST,and for all the period selected by user, and also it should be write the closing balance & the closing balance to opening Balance of Next Month.

*WHEN P_ACCT.ACCTYPE

*IS "AST"

*WHEN TIME

*IS %TIME_SET%

*WHEN FLOW

*IS "F_100"

*REC(EXPRESSION=%VALUE%+[FLOW].[F_120]-[FLOW].[F_130],FLOW=F_999,TIME=TMVL(0,%TIME_SET%))

*REC(EXPRESSION=%VALUE%+[FLOW].[F_120]-[FLOW].[F_130],FLOW=F_100,TIME=TMVL(1,%TIME_SET%))

*ENDWHEN

*ENDWHEN

*ENDWHEN

*COMMIT

i look forward the solution for the following.

1. If the F_100 having the value then only it is calculating the closing balance and writing the opening balance for the next period.

IF the F_100 is not having value then it is not performing. ( my expectation is it should check the calculation of balance F_120-F_130) To do the same if i give ELSE commend it is calculation twice.

Another Option i tried is

//*REC(EXPRESSION=IF([FLOW].[F_100] > 0,[FLOW].[F_100]+[FLOW].[F_120]-[FLOW].[F_130],[FLOW].[F_120]-[FLOW].[F_130],FLOW=F_999,TIME=TMVL(0,%TIME_SET%)))

it is validating but i am getting an error "Root Element Missing." Error in Convertion".

Your Help in this regard is highly appreciated.

Thanks in advance.

Regards,

Guru Rajan.V