How to include Logon Ticket into SAP Shortcut – SSO from ABAP Web to SAP WINGUI
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’
ticket = lv_ticket
ticket_logon_disabled = 1
ticket_creation_failed = 2
kernel_too_old = 3
OTHERS = 4.
IF sy-subrc <> 0.
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.
‘[System]’ “#EC NOTEXT
‘Name=’ sy-sysid “#EC NOTEXT
* SAPLOGON_ID to be used for callbacks
‘Description=’ i_saplogon_id “#EC NOTEXT
‘Client=’ i_client “#EC NOTEXT
* user section
‘[User]’ “#EC NOTEXT
‘Name=’ i_user “#EC NOTEXT
* Logon Ticket
‘at=”MYSAPSSO2=’ lv_ticket ‘”‘
‘Language=’ l_langu “#EC NOTEXT
* Function section
‘[Function]’ “#EC NOTEXT
‘Title=’ i_title “#EC NOTEXT
‘Command=’ l_command “#EC NOTEXT
* Configuration section
‘[Configuration]’ “#EC NOTEXT
* window size
‘GuiSize=’ i_windowsize “#EC NOTEXT
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