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: 

Formatting currency

Former Member
0 Kudos

Test Condition Step Step Description Test Data Expected Result

Budget format 1 Enter in budget in different formats 1234 Change the amount to 1,234.00

Budget format 2 Enter in budget in different formats $1234.55 Change the amount to 1,234.00

how can I convert these 2 test data into the format as given in the expected result i.e 1,234.00?

Also I need to store 1,234.00 without any commas but only with decimals in a DB table how can I achieve this?

Edited by: vinaya pyati on Aug 18, 2009 10:43 AM

Edited by: vinaya pyati on Aug 18, 2009 10:44 AM

2 REPLIES 2

Former Member
0 Kudos

Hi,

Check the FM SD_CONVERT_CURRENCY_FORMAT



DATA: v_cur like TCURX-CURRKEY,
        c_cur(10) type c VALUE '1234 '.
 
 
  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.

Regards,

Vik

Former Member
0 Kudos

Solved by self.