Hello,
here I want to share some knowledge/hints how an online language switch can be implemented.
- SET LOCALE LANGUAGE <SPRAS> changes the current language of the current internal session. see elp.sap.com/abapdocu_702/en/abapset_locale.htm.
- Transactions called by Function TH_REMOTE_TRANSACTION seem to belong to that internal session, so they use that language
- Parameter DEST is not an RFC destination, but 'NONE' is accepted. If you want to execute the function on certain servers, you can use e.g. function TH_SERVER_LIST to get a list of servers (also by RFC).
- using transaction ' ' starts just a session
- 'SESSION_MANAGER' is also a transaction.
- LEAVE PROGRAM terminates a program.
So code snippet to switch language could look like this (usage on your own risk / only for evaluation):
form SWITCH using FUW_SPRAS
FUW_TCODE..
data: LW_TCODE type TSTC-TCODE.
set locale language FUW_SPRAS.
select single TCODE from TSTC into LW_TCODE
where TCODE = FUW_TCODE.
if not LW_TCODE is initial.
call function 'AUTHORITY_CHECK_TCODE'
exporting
TCODE = LW_TCODE
exceptions
OK = 1
NOT_OK = 2.
if SY-SUBRC = 2.
return.
endif.
endif.
call function 'TH_REMOTE_TRANSACTION'
exporting
TCODE = LW_TCODE
DEST = 'NONE'.
leave program.
endform. "SWITCH
-Jürgen-