Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
aamelin1
Participant

Problem


When you working at international multi-language SAP project - you may need to perform testing a lot of functionality at SAP Logon in different languages. Standard SAP approach - to change SAP GUI (SAPLogon) language you need to log-off and log-on again with other language.

IMO, it takes a lot of time to perform a simple action to change language, so, let's try to make a simple functionality to save our time.

Solution


Concept - create a custom tcodes for online switching language. So, these tcodes should call ABAP program with functionality:

  • Set locale language:



SET LOCALE LANGUAGE 'E'.



  • Call a new session with new language via:



CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'LANGUAGE'



  • Close the current session.


 

Implementation example:

  • Create a new program, for example ZBC_LANG


REPORT ZBC_LANG.
CASE sy-tcode.
WHEN 'ZEN'. SET LOCALE LANGUAGE 'E'.
WHEN 'ZRU'. SET LOCALE LANGUAGE 'R'.
WHEN 'ZPT'. SET LOCALE LANGUAGE 'P'.
* WHEN 'Zxx'. SET LOCALE LANGUAGE 'x'.
WHEN OTHERS.
exit.
ENDCASE.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'LANGUAGE'
EXPORTING
tcode = 'SESSION_MANAGER'.


  • Create a list of transactions with names like Z<language> at SE93, for example ZENZPTZRU etc.




How it works


Just put in tcode field "/nz<language>" (i.e. /nzEN, /nzPT etc).

System changes current language without logging-off.


Lang switcher

12 Comments
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Andrey, I'm a little confused why this is necessary? Can you explain further?

There is a standard feature in the SAP Fiori launchpad of SAP S/4HANA to immediately change the logon language of any user using the Settings > Language and Region.

This is a huge timesaver for projects I'm involved in  - some of which have up to 8 languages running currently all of which have to be tested.

And of course it's yet another good reason for shifting to the Fiori launchpad.



Immediate change of logon language via Fiori settings


 

 
aamelin1
Participant
0 Kudos
Hi jocelyn.dart
Yes, you're right, at FIORI you may change language by standard feature, but at SAP Logon for win and java, as I know, you can't do it in simple way.


So, this small tool may be helpful for those who have not yet switched to FIORI.
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos
Ok hmmm.. I feel that would be helpful to state in your introduction?

So essentially this is a SAP Business Suite work around that still works in SAP S/4HANA, for those who want to work in their SAP S/4HANA system as if it was still SAP Business Suite.

I find it fascinating ...  as this sort of development is kind of a tax for avoiding innovation.

 
matt
Active Contributor

At the time of writing, all my employer's customers use SAPGui - even if it's only at the backend.

We develop in English and translate into German. This little tool may be quite helpful to us.

I think the ABAPGit client also uses the same technique when it needs to switch language.

DiegoValdivia
Participant
Thanks Andrey for such a great post!

I've worked as an abap developer many years, but didn't know this was possible in SAP GUI.

It's very annoying to work on some developement that needs translation and then log in again in a different language. If by mistake you close the session, then you need to log in again.

SAP should have added this as a standard behavior many years ago, just as they did in Fiori.

 
abo
Active Contributor
0 Kudos
I got the email notification and I understood immediately that it was about the SAP GUI... and, just like Matthew, I thought of abapGit 🙂
Renan_Correa
Active Contributor

I find it fascinating to see people that ignore that the vast majority of the SAP ERP customers are still running SAP ECC with SAP GUI and treat it like a jurassic thing that you see in museums only.

This is a kind of feature that could have been done by SAP ages ago and helps in a certain context to reduce the pain of the users of the system.

Everybody gets that there are new things in SAP world, but there are many companies still using and rolling out ECC for smaller subsidiaries and they plan to do that before migrating to S/4HANA.

I've seen a Z transaction once to do something similar to that where you could choose the language. I like the post, thank you!

saikatjay
Participant
0 Kudos
Couldn't agree more!
saikatjay
Participant
0 Kudos
Hello Andre,

Amazing tool!

Regards,

Saikat.
florianwolf
Discoverer
0 Kudos

aamelin1 - wow, thanks for sharing. This is really useful.

Anyway, we found one issue. If you're using one of these transaction codes to switch the language a new mode opens. If you're then calling any transaction and going back ("F3") to the SESSION_MANAGER / main menu the following message appears for the user:

Is this an issue you already have a solution for or does this only happen in our systems?

Thanks,
Florian

aamelin1
Participant
Hi florianwolf!

Thanks!

I think a reason of this message describe here - https://me.sap.com/notes/2470128/E :

You could find some special logical handling as below in the function module "NAVIGATION_EXECUTE_OBJECT_HELP".
IF CALL_SY_TCODE = 'SESSION_MANAGER' OR CALL_SY_TCODE = SPACE

OR CALL_SY_TCODE = 'SESS'
OR CALL_SY_TCODE = 'SMEN'
OR CALL_SY_TCODE = 'SES0'.

IF CALL_SY_TCODE <> SPACE.
MESSAGE I375(S#) WITH CALL_SY_TCODE.
ENDIF.
EXIT.
ENDIF.

So, maybe, you can try to change tcode at FM CALL FUNCTION 'ABAP4_CALL_TRANSACTION' to smthng else...
rporpino-netzsch
Explorer

I had the same issue as @florianwolf and tried to change the tcode as per @aamelin1's suggestion but could not find a solution. Then I chose to follow a different path for the same goal. The sample code below works as a charm:

REPORT zlang.

DATA: gv_comm(80) TYPE c,
      gv_syst(80) TYPE c,
      gv_dest     TYPE msxxlist-name,
      gs_rfcsi    TYPE rfcsi.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS p_spras TYPE spras OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.

END-OF-SELECTION.

  CALL FUNCTION 'RFC_SYSTEM_INFO'
    IMPORTING
      rfcsi_export = gs_rfcsi.

  SET LOCALE LANGUAGE p_spras.

  gv_dest = gs_rfcsi-rfcdest.

  CALL FUNCTION 'TH_REMOTE_TRANSACTION'
    EXPORTING
      tcode        = space
      dest         = gv_dest
    IMPORTING
      comm_message = gv_comm
      syst_message = gv_syst.

 

Labels in this area