I saw there are wiki pages posted recently introducing how to launch SAP GUI for Windows transaction from SAP ABAP Web application but they refer to “decent” SSO solution for SAP GUI for windows if you want to void initial logon screen.
It recalls me a tiny job I did together with my colleague Rikardt couple of months ago. We found the way to get rid of initial logon screen using standard Logon ticket.
To be honest, it’s really very simple if you ever look into the content of SAP shortcut file generated by SAP Netweaver Portal Transaction launcher. I did that using http sniffer tool like HTTPWatch.
The following screenshot is an example of such shortcut file, and you should immediately identify the trick is just about assigning SAP logon Ticket to an undocumented shortcut parameter “at”.
ABAP FM CREATE_RFC_REENTRANCE_TICKET can be used to generate logon ticket, and please remember it generate assertion ticket only valid for 120 seconds. You also should notice that this function module was introduced from SAP Basis support package SP14. The sample code is here.
CALL FUNCTION 'CREATE_RFC_REENTRANCE_TICKET'
IMPORTING
ticket = lv_ticket
EXCEPTIONS
ticket_logon_disabled = 1
ticket_creation_failed = 2
kernel_too_old = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
Clearly, the next step is to compose the shortcut file using your own code rather than function module SWN_CREATE_SHORTCUT, so you can include generated ticket for “at” parameter, example:
DATA: l_crlf TYPE char2.
l_crlf = cl_abap_char_utilities=>cr_lf.
CONCATENATE
* System
'[System]' "#EC NOTEXT
l_crlf
'Name=' sy-sysid "#EC NOTEXT
l_crlf
* SAPLOGON_ID to be used for callbacks
'Description=' i_saplogon_id "#EC NOTEXT
l_crlf
* Client
'Client=' i_client "#EC NOTEXT
l_crlf
* user section
'[User]' "#EC NOTEXT
l_crlf
* User
'Name=' i_user "#EC NOTEXT
l_crlf
* Logon Ticket
'at="MYSAPSSO2=' lv_ticket '"'
l_crlf
* Langu
'Language=' l_langu "#EC NOTEXT
l_crlf
* Function section
'[Function]' "#EC NOTEXT
l_crlf
* Title
'Title=' i_title "#EC NOTEXT
l_crlf
* Command
'Command=' l_command "#EC NOTEXT
l_crlf
* Configuration section
'[Configuration]' "#EC NOTEXT
l_crlf
* window size
'GuiSize=' i_windowsize "#EC NOTEXT
l_crlf
INTO l_shortcut.
And then you send the shortcut as MIME object in BSP or Webdynpro response , which you refer to the wiki http://wiki.sdn.sap.com/wiki/display/CRM/CRM+WebUI+-+Launching+transactions+in+GUI+for+Windows or http://wiki.sdn.sap.com/wiki/display/ABAP/ZAPP_INTEGRATOR
Job is done though you still need to make sure the following profile parameters are activated.
login/accept_sso2_ticket = 1
login/create_sso2_ticket = 2