Ansicht
Dokumentation
ABAPSET_COUNTRY - SET COUNTRY
CL_GUI_FRONTEND_SERVICES - Frontend Services CPI1466 during BackupThis documentation is copyright by SAP AG.
SET COUNTRY
SET COUNTRY cntry.
Effect
This statement sets the formatting settings of the language environment for all subsequent 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, time format, and time stamp format are set to a country-specific format in accordance with the entries in columns XDEZP, DATFM, and TIMEFM.
- If cntry is initial, or, more specifically, it contains a blank in the first position, the formatting is set in accordance with the Defaults in the user master record.
If the content of cntry cannot be found in the database table T005X nor contains a blank 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
- Time stamp according to the settings for date, time, and decimal separator
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 is set according to the Defaults 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 of SET COUNTRY.
- The statement SET COUNTRY must not be confused with the obsolete addition COUNTRY
of the statement SET LOCALE LANGUAGE, used for setting the
text environment. In particular, there is no corresponding GET COUNTRY statement.
Example
Setting of the formatting settings of the language environment and their effect on the addition ENVIRONMENT in
embedded expressions in string templates.
General Data in Customer Master General Material Data
This documentation is copyright by SAP AG.
Length: 4674 Date: 20240427 Time: 024051 sap01-206 ( 55 ms )