Get Example source ABAP code based on a different SAP table
Text Environment Language and Text Environment ITOC
Text Environment Language The text environment language> is part of the language settings> of an ABAP program and determines its text environment>. It is valid during an ABAP_ISESS >.
The text environment language is set at the start of each ABAP_ISESS to the logon language> of the current user session>.
It can also be set to a different language for the current ABAP_ISESS using the statement SET LOCALE LANGUAGE >>. The current text environment language can be determined using the method GET_LANGUAGE> of the class CL_ABAP_SYST>> or using the statement GET LOCALE LANGUAGE>>, and is the nominal content of the system field sy-langu>>. The possible single-character abbreviations for the text environment language are stored as language keys in the column SPRAS> of the database table T002>>.
Example ABAP Coding
Assurance that the system field sy-langu> contains the current text environment language, An exception is raised if the system field is overwritten in the program. ABEXA 01344 ABAP_EXAMPLE_END
Text Environment All programs in an ABAP_ISESS > work in a shared text environment that is determined by the text environment language and which can also be set using the statement SET LOCALE LANGUAGE>>. As well as the language, the text environment includes:
A code page> The code page> of the text environment is always the system code page> UTF-16> of the ABAP_ASINSTANCES of a Unicode system> and cannot be changed. The current release supports Unicode systems only. Text environments with other code pages are no longer supported. There is a special feature in which the non-Unicode code page that is used for conversions is the one that would be assigned to the current text environment in a non-Unicode system. This only applies to specific statements, such as reading and writing legacy files> using the ABAP file interface>.
A locale> The locale> properties that belong to the text environment language and country are defined in an ICU (International Components for Unicode) library. This library is made available for AS ABAP and is independent of the operating system of the host computer> of the ABAP_ASINSTANCES >. The main purpose of the text environment it to handle texts in character-like data objects:
The code page> of the text environment affects all operations that depend on the current character set, such as
Casting character-like data objects to byte-like types
Transferring data from and to external storage>
Transferring data using data and communication interfaces>
The locale> of the text environment affects all statements that sort character-like data objects as text, such as
SORT AS TEXT>>
CONVERT TEXT INTO SORTABLE CODE>>
In addition, the text environment language, and not the logon language, is used in the following cases:
The ABAP-specific session variable> LOCALE_SAP>> in SAP HANA and the session variable system_language>> in ABAP CDS contain the current text environment language in reads from ABAP or AB_SQL .
If the logon language for the RFC session> is not defined in the RFC destination> in a remote function call>, it is determined by the current text environment language.
If a language is not specified explicitly in the statement SUBMIT VIA JOB>>, the logon language of the background session> is set implicitly to the current text environment language.
The texts on selection screens> are determined by the current text environment language.