Application Development 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: 

Currency format

Former Member
0 Kudos

Hi All,

I have the currency is in the 10005.08

how to get in : 1,005,08.

Thanks,

srii..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI...

To change the currency to a specified format use the following function module.

Function Module Name: SD_CONVERT_CURRENCY_FORMAT

The following code will help you to get the currency format.

DATA: v_cur like TCURX-CURRKEY,
        c_cur(10) type c VALUE '10005.08'..


  CALL FUNCTION 'SD_CONVERT_CURRENCY_FORMAT'
    EXPORTING
      i_currency                  = v_cur
*   IMPORTING
*     E_CURRENCY_INT_FORMAT       =
    changing
      c_currency_ext_format       = c_cur
   EXCEPTIONS
     WRONG_FORMAT                = 1
     OTHERS                      = 2
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  WRITE: C_CUR.

I think this will greatly help you.

Thanks and regards,

Bhuvaneswari

9 REPLIES 9

Former Member
0 Kudos

hi,

Declare the Char field of length 15 or greater as per the currency field.

use the Write to statement.

data      basic      TYPE p0008-bet01,             " Basic
data  amount type char16.

write basic to amount.

it will display as per ur notation.

Former Member
0 Kudos

Hi Sreedher,

Pass it to type P vaiable ..or use offset this way ..


data : var(10) value '100000',
       var1(10),
       var2(10) .
 
 var1 = var+0(3).
 var2 = var+2(3).
 
 concatenate var1 var2 in to var separated by ','.

hope it solves your problem

Thanks!!

0 Kudos

No arpana we should not hardcode cuase we have lot of currecy values...

0 Kudos

Hi Sridhar,

refer to this link:

hope it helps to you.

Thanks!

Former Member
0 Kudos

Hi,

Follow the path below.

System->User Profile -> Own data -> Defaults(tab)

You can change to any format there and save the changes you made.

Former Member
0 Kudos

Hi,

You can use the string operations OVERLAY , you can do it.

Hope this is useful.

Regards,

Phani.

Former Member
0 Kudos

hi,

check this Note 666849 - Running LAC in non-US locales

thanks

Former Member
0 Kudos

HI...

To change the currency to a specified format use the following function module.

Function Module Name: SD_CONVERT_CURRENCY_FORMAT

The following code will help you to get the currency format.

DATA: v_cur like TCURX-CURRKEY,
        c_cur(10) type c VALUE '10005.08'..


  CALL FUNCTION 'SD_CONVERT_CURRENCY_FORMAT'
    EXPORTING
      i_currency                  = v_cur
*   IMPORTING
*     E_CURRENCY_INT_FORMAT       =
    changing
      c_currency_ext_format       = c_cur
   EXCEPTIONS
     WRONG_FORMAT                = 1
     OTHERS                      = 2
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  WRITE: C_CUR.

I think this will greatly help you.

Thanks and regards,

Bhuvaneswari

0 Kudos

Thanks a lot BHUVANESWARI ...

I have only points to award...

Thank You,

Srii..