ABAP Keyword Documentation → ABAP - Reference → Program Parameters → Language Environment → Formatting Settings
SET COUNTRY
Other versions: 7.31 | 7.40 | 7.54
Syntax
SET COUNTRY cntry.
Effect
This statement sets the formatting settings of the language environment for all following statements of the current internal session.
cntry
expects a character-like data object that either contains a value from the column LAND of the database table T005X or is initial.
-
If
cntry
contains a value from the table T005X, the number format, date format, and time format are set to a country-specific format in accordance with the entries in columns XDEZP, DATFM, and TIMEFM. -
If
cntry
is initial (contains a space in the first position), the formatting is set in accordance with the fixed values in the user master record.
If the content of cntry
cannot be found in the table T005X and does not have a space in the first position, sy-subrc
is set to 4 and the following settings are made:
- The decimal separator is a decimal point and the thousands separator is a comma.
- Date in the form "mm/dd/yyyy"
-
Time in 24-hour format
System Fields
sy-subrc | Meaning |
---|---|
0 | The specified country key was found in the database table T005X or a space was specified. |
4 | The specified country key was not found in database table T005X. |
Notes
-
As long as the statement
SET COUNTRY
is not executed in an internal session, the formatting corresponds to the fixed values in the user master record. -
If certain formatting settings are only required for one or a few formattings, the formatting option
country
can be used for embedded expressions in string templates instead ofSET COUNTRY
. -
Do not confuse the statement
SET COUNTRY
with the obsolete additionCOUNTRY
of the statementSET LOCALE LANGUAGE
, used for setting the text environment. In particular, it does not have a correspondingGET COUNTRY
statement.
Example
See Character String Templates, Formatting
Settings and WRITE
, Cutoff Behavior.