2013 Jul 04 10:27 AM
Hi all,
I created a Routine in VOFM. While I am fetching currency values from TCURR, if it is negative Ex : UKURS = 6.25354- I need to divide by 1.
(1 / 6.25354).
But the problem is division is not taking place. lv_ukurs1 contains no value.
Here is the code.
data ; lv_ukurs type tcurr-ukurs,
lv_ukurs1 type tcurr-ukurs,
if wa_tcurr-ukurs < 0.
lv_ukurs = wa_tcurr-ukurs * -1. " to change the -ve value to +ve value multipied by -1
lv_ukurs1 = 1 / lv_ukurs.
endif.
Thanks in Advance.
Regards,
Karthik
2013 Jul 04 10:50 AM
Please make sure that wa_tcurr-ukurs contains value. VOFM routines dont take fixed point arithmetic into account( it might be possible that because of this the result is so small that its value is zero), so instead of carrying out multiplication or division in routine, create a function module and pass the values of variables to FM and do the division in FM and retrieve final result by calling this function module in routine.
Regards
2013 Jul 04 10:50 AM
Please make sure that wa_tcurr-ukurs contains value. VOFM routines dont take fixed point arithmetic into account( it might be possible that because of this the result is so small that its value is zero), so instead of carrying out multiplication or division in routine, create a function module and pass the values of variables to FM and do the division in FM and retrieve final result by calling this function module in routine.
Regards
2013 Jul 08 8:12 AM
Hi ,
Thanks for your comments. its working fine as per your suggestion.
But I dont know why this division logic is not working in VOFM T code. But the same logic is working in SE 38 program. Its really surprised me.
Thanks,
Karthik
2013 Jul 08 8:47 AM
This is because VOFM routines dont take fixed point arithmetic into account whereas in SE38, if you check attributes, fixed point arithmetic check box is marked.
Regards
2013 Jul 08 9:33 AM