Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 7846

amount(DMBTR) on division gives wrong values

$
0
0

Hi Expert,

 

I have to divide a amount field by another amount field.

 

Data: lv_amount type dmbtr,

         lv_total type dmbtr,

        lv_resullt type dmbtr.

 

lv_result = lv_amount  /  lv_total.

 

suppose the value is

lv_amount  = 5000.00

lv_total = 7500.00

I am getting lv_result = 0.01

But expected value is 0.66

 

I have searched in scn and the solutions given are not working.

1. program attribute set floating point arithmetic - (I am doing implicit enhancement)standard program I can't change

2. Use  other type like

lv_amt(13) type p decimals 2.

lv_tot(13) type p decimals 2.

lv_res(13) type p decimals 2.    

even if i pass the value to the above variable and I calculate

I am getting lv_res = 0.01  

3. If I hard code and divide I am getting the expected result. - but in my case I need to take the value from std prg so i can't hard code.

 

If any one have encountered the same please tell me how you solved it.


Viewing all articles
Browse latest Browse all 7846

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>