Skip to Content
0

value after currency conversion for JPY

Apr 23 at 10:40 AM

25

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Himanshu Gupta
Apr 23 at 10:42 AM
0

Hi Pooja,

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 23 at 10:44 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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?

0
Former Member

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

0
Kiran K Apr 23 at 10:46 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0
Former Member
0