cancel
Showing results for 
Search instead for 
Did you mean: 

Currency conversion

Former Member
0 Kudos

Hi,

can you please tell me what is the process for converting the currency in below format.

if amount is 2,000.34(INR--Two thousand rupees 34 Paise).This should be displayed like 2.000,34.

Inplace of commas dots should be appeared and vice versa.

Thanks and Regards,

K.krishna .

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

answered

Former Member
0 Kudos

Hello ,

try like this ...

data l_amount c(20) type c.

write amount into l_amount currency 'INR'. "it will take of curreny decimal format and user notation as well.

regards

Prabhu

Former Member
0 Kudos

Use abap set country to change the format.

Otherwise do a simple logic:-

(Using string type) replace all '.' with "," and vice versa.

hope it helps.

Former Member
0 Kudos

Use below FM by specifying the required format:

CALL FUNCTION 'HRGPBS_HER_FORMAT_AMOUNT'
      EXPORTING
        P_AMOUNT           = G_MAXBT
        P_CURRENCY         = G_WAERS
        P_REQUIRED_FORMAT  = '9.99.999,99'
      IMPORTING
        P_ERROR            = L_ERROR_DURING_FORMAT
        P_ERROR_AMOUNT     = L_ERROR_AMOUNT
        P_ERROR_CURRENCY   = L_ERROR_CURRENCY
        P_ERROR_OVERFLOW   = L_ERROR_OVERFLOW
      CHANGING
        P_FORMATTED_AMOUNT = G_RWBTR.
 
    IF L_ERROR_DURING_FORMAT NE 0.
      IF L_ERROR_DURING_FORMAT = 1.
        MESSAGE E002 WITH 'Error during currency format conversion'.
      ELSE.
        MESSAGE E002 WITH 'Error during currency format conversion'.
      ENDIF.
    ENDIF.

Thanks and Regards

Former Member
0 Kudos

Hi Krishan,

Why not your use user profile and set as your desire currency format.

Regards,

Syed Tayab Shah

aidan_black
Active Contributor
0 Kudos

Hi,

You can use the ABAP SET COUNTRY to set to the desired format at the start of the document window (MAIN) as described in SAP Note #32105.

Regards,

Aidan