on 11-24-2020 1:45 PM
I have requirement where in i need to change sy-langu depending upon user selection.
My selection screen has different language options, once the user select any option for e.g 'English'
Then the next screen will be shown in English language. For this i have used SET LOCALE LANGUAGE followed by user selection like 'E' for English, 'D' for German and so on.
The issue is like when the user selects the language 1st time say German then the next screen changes to selected language as expected, but now if i come back to main screen and now i select some other language say English so now the next screen should change to English but in my case it Stays in German.
That is whatever language i select at first it stays in that language.
AT SELECTION-SCREEN.
CLEAR: gv_lang. gv_lang = sy-langu.
CASE sscrfields.
WHEN 'DE'.
SET LOCALE LANGUAGE 'D'.
WHEN 'EN'.
SET LOCALE LANGUAGE 'E'.
WHEN 'FR'.
SET LOCALE LANGUAGE 'F'.
WHEN 'RU'.
SET LOCALE LANGUAGE 'R'.
WHEN 'PL'.
SET LOCALE LANGUAGE 'L'.
WHEN 'DA'.
SET LOCALE LANGUAGE 'K'.
WHEN 'SV'.
SET LOCALE LANGUAGE 'V'.
WHEN 'CS'.
SET LOCALE LANGUAGE 'C'.
WHEN OTHERS.
SET LOCALE LANGUAGE 'E'.
ENDCASE.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION' "#EC CI_SUBRC
* STARTING NEW TASK 'NEW'
DESTINATION 'NONE'
EXPORTING
tcode = 'ZLECI'
EXCEPTIONS
call_transaction_denied = 1
tcode_invalid = 2
OTHERS = 3.
IF sy-subrc = 0.
"Do nothing
ENDIF.
IF gv_lang IS NOT INITIAL.
SET LOCALE LANGUAGE gv_lang.
ENDIF.
The problem is when it goes inside the other Tcode when ABAP4_CALL_TRANSACTION is called at first it updates the language but it fails to update it next time.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.