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: 

Multiplying Currency Field

Former Member
0 Kudos

Hi,

I am trying to multiply 2 fields (TYPE KBETR) and store the result in a field (KBETR). When I multiply 722.00 * 279.00 value is getting stored as 20143800.00 instead of 201438.00. Why? & how to correct it.

Thanks in advance.

Regards,

Balaji Viswanath.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Balaji,

Do you have "Fixed point arithmetic" set in the attributes of your program.

Regard,

Chester

8 REPLIES 8

aaron_morden2
Contributor
0 Kudos

Try debugging your code. It should work fine.


data: field1 type KBETR,
      field2 type KBETR,
      field3 type KBETR.

field1 = '722.00'.
field2 = '279.00'.

field3 = field1 * field2.

WRITE: / field3.

Output:

201,438.00

Former Member
0 Kudos

Hello Balaji,

Do you have "Fixed point arithmetic" set in the attributes of your program.

Regard,

Chester

Former Member
0 Kudos

Hi,

The resule field should also the type KBETR.

i ahve writen an example program and it is working fine

data: var1 type KBETR.

data: var2 type KBETR.

data: var3 type KBETR.

var1 = '722.00'.

var2 = '279.00'.

var3 = var1 * var2.

Write:/ var3.

Regards

Sudheer

former_member194797
Active Contributor
0 Kudos

What is the aim of the operation ? In which business case do you have to multiply an amount by another amount ? What is the unit of the result ? Square currency unit ?

Former Member
0 Kudos

Hi Balaji,

If you are handling Japan/Korean currency then it will be multiplied by internally 100 by SAP itself . Please check the function module CURRENCY_AMOUNT_SAP_TO_DISPLAY. Here you have to pass the amount and currency key then you will get the SAP display for the amount entered.

<b><REMOVED BY MODERATOR></b>

Regards,

Shaju

Message was edited by:

Alvaro Tejada Galindo

Former Member
0 Kudos

check currency setting in User Profile-Own Data-Decimal

hope it will resolved.

0 Kudos

Hi,

Actually I have written the code inside include MV45AFZZ in turn it's under include SAPMV45A, in that Fixed point arithmetic is not selected. Since it's standard SAP program I can't change it. So now I am dividing the output by 100.

Thanks to everyone.

Regards,

Balaji Viswanath.

0 Kudos

Hi Balaji,

Yes, you will need to divide by 100. With fixed point aritmetic this calculation would have been performed successfully.

Regards,

Chester