SET LANGUAGE lang.
This statement loads the list headers and text symbols of the text pool specified in the lang language. lang must be a character-type (and prior to Release 6.10, a flat) data object that contains a language key of length 1. The possible language keys are contained in the column SPRAS of the database table T002. The loaded text elements are only valid for the current program and not for the programs called within it. If lang contains a space, the behavior is undefined.
If there is no text pool for the specified language, the system loads the text pool in the secondary language which, as of Release 6.20, is specified in the profile parameter> zcsa/second_language. If no secondary language is set, no new text pool is loaded and the system sets sy-subrc to 4. The program then continues to use the text elements from the previous text pool.
If list headers and text symbols are missing in a text pool loaded with
SET LANGUAGE but existed in the previously-loaded text pool, these are initialized as of Release 6.20. Prior to Release 6.20, they retained their previous value.
System fields
sy-subrc | Meaning |
0 | The text pool of the specified language or secondary language (as of Release 6.20) was loaded. |
4 | The text pool of neither the specified language nor the secondary language (as of Release 6.20) could be loaded. |
Output of the text symbol TEXT-010 in different languages. Prior to Release 6.20, output of a text symbol in a language only occurs if the text symbol exists in that language. As of Release 6.20, output occurs for every language if the text pool exists in the secondary language.
DATA langu LIKE sy-langu.
SELECT spras FROM t002
INTO langu.
SET LANGUAGE langu.
IF sy-subrc = 0.
WRITE: / langu, text-010.
ENDIF.
ENDSELECT.