Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in VOFM routine

Former Member
0 Likes
1,754

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

1 ACCEPTED SOLUTION
Read only

former_member188827
Active Contributor
1,229

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

4 REPLIES 4
Read only

former_member188827
Active Contributor
1,230

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

Read only

0 Likes
1,229

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

Read only

0 Likes
1,229

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

Read only

0 Likes
1,229

Thanks Dude.. I got it.