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: 

convert amount into US format

Former Member
0 Kudos

Hi

can anybody suggest me to convert amount to U.S. format

like

amount = 3000

US format = 3,000

Thanks

Aditya

3 REPLIES 3

former_member181995
Active Contributor
0 Kudos

Aditya,

it depends how your user setting are defined.

just goto transaction SU01>user name>default >look at the decimal notation.set from here.and logoff system and login again to reflect your changes.

Amit.

Former Member
0 Kudos

Hi Aditya,

Refer these Function modules Related to Amount and Currency

CURRENCY_AMOUNT_SAP_TO_IDOC - Convert currency to IDOC format

CONVERT_TO_LOCAL_CURRENCY - Conversion of currency

CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all

character fields), not right justifed as numbers normally are.

CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.

CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency

Example : Convert amount to/from string

Amount to string:

CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'
EXPORTING
betrg = 3000
WAERS = 'DKK'
* NEW_DECIMAL_SEPARATOR =
* NEW_THOUSANDS_SEPARATOR =
IMPORTING
STRING = slam
.

String to amount:

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'
EXPORTING
string = slam2
DECIMAL_SEPARATOR = '.'
* THOUSANDS_SEPARATOR =

WAERS = 'HUF'
IMPORTING
BETRG = b2
* EXCEPTIONS
* CONVERT_ERROR = 1
* OTHERS = 2.

Regards,

Vivek

Former Member
0 Kudos

Use the statement in ur program.

SET COUNTRY 'US'.

Effect:

SET COUNTRY cntry.

This statement specifies the predefined output formats for the decimal format (selection of decimal separators and thousand separators) and the date format in all programs of the current internal session for all subsequent outputs in ABAP lists. If the value specified in cntry exists as the country key in the column COUNTRY of the database table T005X, the output of numbers and dates is formatted according to the entries in columns XDEZP and DATFM.