Application Development 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: 

Issue with simple calculation

Former Member
0 Kudos

Hello, Can someone please tell me what I am doing wrong here. With this code I am getting a right value of 7.85 into m_kbetr_lb in my test program but I am getting a value of 784844.72 in my user-exit . I am not sure what is going on here. Any suggestions please.

data : m_kbetr_kg like komv-kbetr,
          m_kbetr_lb  like komv-kbetr,
          m_lb            type p deciamls 5 value '2.20462'.

m_kbetr_kg = 356 / 100.
m_kbetr_lb  = m_kbetr_kg * m_lb
write 😕 m_kbetr_lb..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In the Report Attribute you see the check box Fixed Point Arithmetic which is checked. Where as in the user exit this might not be happened.

If you uncheck Fixed Point Arithmetic check box and execute the program.

7 REPLIES 7

guilherme_frisoni
Contributor
0 Kudos

Hi,

your user exit has the option Fixed point arithmetic unchecked.

So, you have to disconsider decimals, besides they are shown in debug, you calculation don't consider them.

Frisoni

former_member187457
Active Contributor
0 Kudos

Hi,

Is this the actual code that you are using...

if so please check the spelling of decimal...

thnx

Rahul

Former Member
0 Kudos

Hi,

In the Report Attribute you see the check box Fixed Point Arithmetic which is checked. Where as in the user exit this might not be happened.

If you uncheck Fixed Point Arithmetic check box and execute the program.

0 Kudos

Hi,

I have unchecked the fixed point arithmetic in my test program and now I get funky values in my test program as well. So the fixed point arithmetic should be the issue. How can I fix it in my exit with the code?

Edited by: jackie stone on Jul 22, 2009 6:19 PM

0 Kudos

Or may be, is there a FM that I can use to convert values from KG to LB and vice-versa?

0 Kudos

call function 'UNIT_CONVERSION_SIMPLE'

exporting

input = weight_in

unit_in = 'LB'

unit_out = 'KG'

importing

output = weight_out

0 Kudos

Thanks Stony, issue resolved.