2018 Apr 23 11:40 AM
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
2018 Apr 23 11:42 AM
Hi Pooja,
during round off, use the variable type as int as staging variable. it will take out decimals from it.
2018 Apr 23 11:44 AM
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
2018 Apr 23 12:02 PM
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?
2018 Apr 23 12:06 PM
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
2018 Apr 23 11:46 AM
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.
2018 Apr 23 11:49 AM
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
2018 Apr 23 11:53 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |