Application Development and Automation 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: 
Read only

Currency format

Former Member
0 Likes
1,841

Hi All,

I have the currency is in the 10005.08

how to get in : 1,005,08.

Thanks,

srii..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,581

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
Read only

Former Member
0 Likes
1,581

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.

Read only

Former Member
0 Likes
1,581

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!!

Read only

0 Likes
1,581

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

Read only

0 Likes
1,581

Hi Sridhar,

refer to this link:

hope it helps to you.

Thanks!

Read only

Former Member
0 Likes
1,581

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.

Read only

Former Member
0 Likes
1,581

Hi,

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

Hope this is useful.

Regards,

Phani.

Read only

Former Member
0 Likes
1,581

hi,

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

thanks

Read only

Former Member
0 Likes
1,582

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

Read only

0 Likes
1,581

Thanks a lot BHUVANESWARI ...

I have only points to award...

Thank You,

Srii..