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

value after currency conversion for JPY

Former Member
0 Likes
2,498

Hello,

The USD amount is multiplied by JPY exchange rate and value is like 12345.67899

The requirement is to have the amount as 12346.

I am able to round off the value, however it comes out as 12346.00

The amount 12346.00 is a global variable and declared as a Type C.

This should be true only when it is JPY.

Any help, how to do it.

Already searched the forum could not find the solution.

Thanks

Hello,

The USD amount is multiplied by JPY exchange rate and value is like 12345.67899

The requirement is to have the amount as 12346.

I am able to round off the value, however it comes out as 12346.00

The amount 12346.00 is a global variable and declared as a Type C.

This should be true only when it is JPY.

Any help, how to do it.

Already searched the forum could not find the solution.

Thanks

7 REPLIES 7
Read only

former_member564522
Active Participant
0 Likes
2,188

Hi Pooja,

during round off, use the variable type as int as staging variable. it will take out decimals from it.

Read only

Former Member
0 Likes
2,188

Hello Himanshu,

Thank for your answer. When I am debugging the value is 12346 only but it prints as 12346.00

This is the issue.

Thanks

Read only

0 Likes
2,188

You wrote "The amount 12346.00 is a global variable and declared as a Type C." so how could it be "12346" in debug and "12346.00" output; should be two different variables.

Do you use CONVERT_TO_FOREIGN_CURRENCY and do you use a WRITE <amount_field> CURRENCY 'JPY' TO <char_field> or a tool like BAPI_CURRENCY_CONV_TO_[EX,IN]TERNAL.

Could you post your code and the DATA definitions?

Read only

0 Likes
2,188

Here is the code

DATA: wa_input TYPE P DECIMALS 8,
wa_output TYPE P DECIMALS 0.

wa_input = va_price.

CALL FUNCTION 'ROUND'
EXPORTING
INPUT = wa_input
IMPORTING
OUTPUT = wa_output
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.

va_price = wa_output.

In global variable declaration it is like

va_price(20) type c, " Price.

Now va_price gets the value 12346 but when it prints in report it is 12346.00

va_price initially is 12345.67899 after conversion.

Thanks

Read only

kiran_k8
Active Contributor
0 Likes
2,188

Pooja,

Don't we know need to convert USD to JPY first and then multiply with the JPY exchange rate ? JPY doesn't have decimals.

Kindly check in SCN regarding JPY currencies, you will get more info.

K.Kiran.

Read only

Former Member
0 Likes
2,188

Hello Kiran,

I have already checked in the SCN could not get any satisfactory answer that is why i have posted. Conversion is done. It is only the issue with the decimals getting displayed.

Thanks

Read only

kiran_k8
Active Contributor