1. ... COUNTRY c
2. ... MODIFIER m


Sets the text environment according to the specified language lg.

The text environment includes the language stored in SY-LANGU, the locale categories LC_CTYPE and LC_COLLATE and the SAP character set.

You determine the text environment by accessing the SAP text environment table TCP0C with the specified key


If the country is not specified, it is removed from the table TCP0D. If TCP0D is empty, the setting COUNTRY = SPACE is used to access TCP0C. If the modifier is not specified, the setting MODIFIER = SPACE is used to access TCP0C.

The text environment affects all operations specific to the character set (such operations include ABAP/4 character processing statements, screen output to the front-end, data transmission between the application server and the front-end, data transmission by RFC, and printing).

The locale category LC_COLLATE affects the behavior of the SORT ... AS TEXT and CONVERT TEXT statements.

When an internal mode is opened (in other words, when a roll area is opened), the text environment is automatically set to the active user's language as specified in the user master record. Therefore, you usually do not need an explicit SET LOCALE statement.

You only have to use SET LOCALE if you want to program a special text environment regardless of the active user's language.

You should take particular care when switching back and forth between different text environments or if you use a text environment which is not compatible with the front-end character set.


If a language spoken in different countries (or, to be more politically precise, in different territories) has different text environments for different countries, you can use the addition COUNTRY c to specify the country for a language.


If a language in a country has different text environments (e.g. Duden sorting (ä as a, ö as o etc.) versus telephone book sorting (ä as ae, ö as oe etc.) in Germany), you can use the addition MODIFIER m to specify a further modifier for the language and country.

The values 'BINARY', 'C', 'POSIX' and 'RAW' are not allowed as modifiers because they are reserved for a later development intended to support 'binary' text environments.

The special form SET LOCALE LANGUAGE SPACE (or lg contains SPACE) resets the text environment to the language of the active user as specified in the user master record. In this case, specifying COUNTRY c and/or MODIFIER m has no effect.