Skip to Content
0
Former Member
Nov 20, 2012 at 01:29 AM

Smart form currency comparision issue

17 Views

I am working on smart form change.

My smart form is using field "cus_stat-tot_PYMT_ADJ". however I need to replace another field with this cus_stat-tot_PYMT_ADJ (which has a value with '457-' or '457+') and i did replaced &cus_stat-tot_PYMT_ADJ& .

and I did coding like below:

wrk_amt = CUS_STAT-TOT_PYMT_ADJ.
write wrk_amt to work_amt.concatenate '$' work_amt into work_amt.CONDENSE work_amt NO-GAPS.*write work_amt to CUS_STAT-TOT_PYMT_ADJ(19) RIGHT-JUSTIFIED.

How ever it is giving dump at this below code(dump is because it doesnot accept "-" or "+").

How to get rid of this dump ?

FORM %CO8.
data: work_amt(21) type c,
wrk_amt type p decimals 2.if cus_stat-tot_PYMT_ADJ < 0.
v_sign = '-'.
work_amt = cus_stat-tot_PYMT_ADJ.
work_Amt = work_amt * -1.
cus_stat-tot_PYMT_ADJ = work_amt.else.if cus_stat-tot_PYMT_ADJ > 0.
v_sign = '+'.else.if cus_stat-tot_PYMT_ADJ = '0'.
v_sign = ' '.endif.endif.endif.
wrk_amt = cus_stat-tot_PYMT_ADJ.write wrk_amt to work_amt.concatenate '$'
work_amtinto work_amt.CONDENSE work_amt NO-GAPS.write work_amt to cus_stat-tot_PYMT_ADJ
RIGHT-JUSTIFIED.
ENDFORM. " %CO8

Thanks in adv