Skip to Content

How to determine SAP GUI Logon type during runtime?

Hello All,

I have a requirement to detect the SAP GUI Logon type (GUI for Windows vs. GUI for Java) during the execution of a program.

Is this possible?

Perhaps it would be easier to detect the type of machine; PC vs. Mac ?

Any help would be appreciated.

Thanks in advance,

AK

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Sep 21, 2010 at 12:30 AM

    Hello,

    You can try transaction SM04.

    Regards,

    David

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 21, 2010 at 05:34 AM

    Hi,

    After trace of SM04,

    You could check this prg RSM04000_ALV.

    For example:
    DATA: BEGIN OF usr_tabl OCCURS 10.
            INCLUDE STRUCTURE uinfo.
    DATA: END OF usr_tabl.
     
    DATA: th_opcode(1)                    TYPE x.
     
    CONSTANTS: opcode_list                     LIKE th_opcode VALUE 2.
     
    CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_list
      ID 'TAB' FIELD usr_tabl-*sys*.
     
    IF sy-subrc = 0.
    *  CASE usr_tabl_alv-type.
    *    WHEN 2.   usr_tabl_alv-ext_type = text-052." (system)
    *    WHEN 4.   usr_tabl_alv-ext_type = text-035." (Gui)
    *    WHEN 32.  usr_tabl_alv-ext_type = text-036."(RFC)
    *    WHEN 202. usr_tabl_alv-ext_type = text-039." (Plug-in &).
    ENDIF.

    May it helps you.

    Regards,

    DS.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 21, 2010 at 12:43 AM

    Hello Aaron,

    Please have a look at Class 'CL_GUI_FRONTEND_SERVICES' - there are many Static Methods in this Class which you could use. You may have to call more than one Method if a single Method does not fit your requirement.

    Cheers,

    Sougata.

    p.s. Method 'GET_PLATFORM' looks interesting from your perspective.

    Edited by: Sougata Chatterjee on Sep 21, 2010 11:02 AM

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 21, 2010 at 05:35 PM

    I found how to do it.

    DATA: lv_platform TYPE i.

    lv_platform = cl_gui_frontend_services=>get_platform( ).

    CASE lv_platform.

    when cl_gui_frontend_services=>platform_unknown. write:/ 'UNKNOWN'.

    when cl_gui_frontend_services=>platform_windows95. write:/ 'WINDOWS95'.

    when cl_gui_frontend_services=>platform_windows98. write:/ 'WINDOWS98'.

    when cl_gui_frontend_services=>platform_nt351. write:/ 'NT351'.

    when cl_gui_frontend_services=>platform_nt40. write:/ 'NT40'.

    when cl_gui_frontend_services=>platform_nt50. write:/ 'NT50'.

    when cl_gui_frontend_services=>platform_mac. write:/ 'MAC'.

    when cl_gui_frontend_services=>platform_os2. write:/ 'OS2'.

    when cl_gui_frontend_services=>platform_linux. write:/ 'LINUX'.

    when cl_gui_frontend_services=>platform_hpux. write:/ 'HP UNIX'.

    when cl_gui_frontend_services=>platform_tru64. write:/ 'TRUS64'.

    when cl_gui_frontend_services=>platform_aix. write:/ 'AIX'.

    when cl_gui_frontend_services=>platform_solaris. write:/ 'SOLARIS'.

    when cl_gui_frontend_services=>platform_windowsxp. write:/ 'WINDOWS XP'.

    WHEN cl_gui_frontend_services=>platform_macosx. write:/ 'MACOSX'.

    WHEN OTHERS.

    ENDCASE.

    Thanks to everyone for their time,

    AK

    Add comment
    10|10000 characters needed characters exceeded