SAP TEXT ENVIRONM - Guide
Get Example source ABAP code based on a different SAP table
Text Environment
ABAP_BACKGROUND
The
By default, the text environment of an ABAP_ISESS is determined by the
ABAP_RULE
Set the statement
ABAP_DETAILS
ABAP-coded services usually expect the text environment to be specified by the current user's logon language. The services are not designed to handle text environment switches of ABAP_ISESSNS within the code.
If the text environment has to be switched for a specific service due to the following exceptions, this must be done only temporarily. This means that a switched text environment must be reset within the same program context to prevent unexpected behavior in other programs within the same ABAP_ISESS .
Exception
Switching the text environment within the code may be necessary in the following cases:
ABAP_EXAMPLE_BAD
The following source code shows a text environment switch within a method, where the text environment is not reset before exiting the method. This poses the danger of continuing within the wrong text environment after returning from the method.
SET LOCALE LANGUAGE ...
...
ENDMETHOD.>
ABAP_EXAMPLE_END
ABAP_EXAMPLE_GOOD
The following source code shows a text environment switch within a method, where the text environment is reset to its original state before exiting the method.
DATA env_lang TYPE tcp0c-langu.
GET LOCALE LANGUAGE env_lang.
SET LOCALE LANGUAGE ...
...
SET LOCALE LANGUAGE env_lang.
ENDMETHOD.>
ABAP_EXAMPLE_END