Skip to Content

value after currency conversion for JPY

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 23 at 10:42 AM

    Hi Pooja,

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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 23 at 10: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

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Apr 23 at 10: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.

    Add comment
    10|10000 characters needed characters exceeded