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

jpy currency problem

Former Member
0 Likes
3,048

Hello,

I am workin as a abap programmer

I recently got a mini project in which i had to maintain the flight details. i did the project in module pool programming trhere i encountered a problem with the japanese yen currency, the price when saved in the database gets divided by 100(eg 8 gets stored as 0.08) and when i retreive it gets multuiplied by 100. Now the problem is tht whenever i press enter or anything the price on the screen keeps on getting multiplied by 100. How can i avert this situation. Pls help.

P.S i am not geting the above said problem for my total field

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,102

Hi,

currencies like jpy are stored divided by 100 at the frontend.

But are stored with there actual values at backend.

Are you multiplying the amounts by 100 before displaying? then its possible that the operation repeats everytime you press enter, owing to the event at which you are performing the operation.You can debug and clarify the same.

i would suggest use the FM as mentioned above.

7 REPLIES 7
Read only

Former Member
0 Likes
2,102

Hi,

Dont do the manual calculation like multiply by 100. use the function module CURRENCY_AMOUNT_SAP_TO_DISPLAY pass the currency key and amount you can correct amount.


CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_DISPLAY' "
EXPORTING
currency =  tcurc-waers " example 'JPY'
amount_internal =  wmto_s-amount "100
IMPORTING
amount_display =  wmto_s-amount "10000
EXCEPTIONS
INTERNAL_ERROR = 1 "

or use 'BAPI_CURRENCY_CONV_TO_EXTERNAL' pass the currency key and amount you can get correct amount.

Regards,

Dhina..

Edited by: Dhina DMD on Jul 29, 2011 8:10 AM

Read only

Former Member
0 Likes
2,103

Hi,

currencies like jpy are stored divided by 100 at the frontend.

But are stored with there actual values at backend.

Are you multiplying the amounts by 100 before displaying? then its possible that the operation repeats everytime you press enter, owing to the event at which you are performing the operation.You can debug and clarify the same.

i would suggest use the FM as mentioned above.

Read only

0 Likes
2,102

no i am not multiplying the price field by 100. i am using a table control nd in tht when the price field is displayed it gets multiplied by 100

Read only

0 Likes
2,102

Hi,

Since u are using table control u mite be displaying the price field before the currency field

in ur PAI try validating the currency field before u display the price field

thanks & regards.

Read only

0 Likes
2,102

thanks it proved helpful

Read only

Former Member
0 Likes
2,102

try validating the fields in such a way that currency should be validated first then price. So once if currency got validated, fare will be entered according to currency.

Thanks

Varun.

Read only

Former Member
0 Likes
2,102

Hi ,

in your Table control Structure ,maintain field for Currency ,and assign this currency field as a Currecy key field to the amount field.

so system will do the amount converion based on the currency key attached to it...

regards

Prabhu