‎2011 Jul 29 6:57 AM
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
‎2011 Jul 29 7:10 AM
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.
‎2011 Jul 29 7:07 AM
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
‎2011 Jul 29 7:10 AM
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.
‎2011 Jul 29 7:48 AM
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
‎2011 Jul 29 7:56 AM
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.
‎2011 Jul 29 7:59 AM
‎2011 Jul 29 7:47 AM
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.
‎2011 Jul 29 8:01 AM
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