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: 

Currency related

Former Member
0 Kudos

Hi all

I am having one problem related to currency

DATA: lv_wavwr TYPE wavwr,

lv_price TYPE wavwr,

fkimg type MENG13

lv_price =.090

fkimg = 200.000

I am usung this statement for calculation.

lv_wavwr = lv_price * fkimg.

The result i am getting is 18000.000

It should be 180.

Could any body help?

8 REPLIES 8

Former Member
0 Kudos

goto the attributes of the program and check if <b>Fixed Point Arithmetic</b> checkbox is checked or not, if not checked check that

<b>Fixed point arithmetic</b>

If you mark this checkbox, all caluculations in the program will use

fixed point arithmetic.

If you do not, packed numbers (ABAP/4 type P, Dictionary types CURR, DEC

or QUAN) will be treated as integers when they are used in assignments,

comparisons and calculations, irrespective of the number of decimal

places defined. Intermediate results in arithmetic calculations will

also be rounded to the next whole number. The number of decimal places

defined is only taken into account when you output the answer using the

WRITE statement.

Message was edited by:

Chandrasekhar Jagarlamudi

0 Kudos

where i can set the fixed point arthemetic operation inmenus

0 Kudos

goto Se38

give the program name and press change button

in menu GOTO----->Attributes

at the botton u can see one checkbox <b>Fixed Point Arithmetic</b>

0 Kudos

Thanks a lot.

sreenivasa_reddy
Participant
0 Kudos

First

write: lv_prive to lv_price_temp units 'give the unit '.

then mutiply it will work

Former Member
0 Kudos

HI Vikram,

Write while outputting in the following way.

data : v_amount(17) type c.

WRITE lv_wavwr to v_amount Currency 'USD'.

write:/ v_amount.

Hope this will solve your problem.

Reward if help ful.

Instead of hardcoding, u can also write wa_bkpf-waers.

Thanks.

Former Member
0 Kudos

Hi

Dont refer data dictionary in Currency field. Instead declare it by using type P.

Like

Data:lv_wavrw type p decimals 3,

lv_price type p decimals 3,

fkimg type p decimals 3.

Then do the multiplication. It will work fine.

Reward me if its helpful.

Regards

Ravi

Former Member
0 Kudos

question has been answered

Thanks alot