‎2008 Aug 05 11:50 AM
Hi
can anybody suggest me to convert amount to U.S. format
like
amount = 3000
US format = 3,000
Thanks
Aditya
‎2008 Aug 05 11:54 AM
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.
‎2008 Aug 05 3:23 PM
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
‎2008 Aug 05 3:34 PM
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.