Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Program Parameters →  Language Environment →  Formatting Settings 

SET COUNTRY

Short Reference

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 SET COUNTRY statement 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, instead of using SET COUNTRY, you can use the formatting option country for embedded expressions in string templates.
  • Do not confuse the statement SET COUNTRY with the obsolete addition COUNTRY of the statement SET LOCALE LANGUAGE, used for setting the text environment. In particular, it does not have a corresponding GET COUNTRY statement.