To format a currency amount with decimals according to the currency use WRITE
and the CURRENCY option.
Currency keys an d numbers of decimals are
defined in table TCURX Decimal Places in Currencies.
Example 1:
Formatting an amount in Kuwatian Dinars:
Dmbtr = 123456.
Write dmbtr
currency 'KUD'
123.456
Write dmbtr currency
'USD'
1234.56
Note that the formatting does not depend on the
number of decimals in the number in the program.
Dmbtr =
'12.3456'.
Write dmbtr currency 'USD'
1234.56
To format
the decimal and thousand sepearators according to the settings for a specific
country, use the statement SET COUNTRY <country key>
Settings for
countries are defined in table T005 Countries.
The country key used in
the statement is field LAND1
Example:.
set country 'US'
Saturday, July 26, 2014
5
ABAP Tips: Language Dependent Formatting of Amount and Currency
To format a currency amount with decimals according to the currency use WRITE and the CURRENCY option. Currency keys an d numbers of deci...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment