Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BSP Page logout problem

Hello @ all,

I have a BSP page with a logonpage which I have customized in SICF. Now I want to have a button where I can close application and get back to the logon screen. Can some one explain me how to realize this.I´m using this as startpage to my bsp:

<%@page language="abap" %>
<%
  " PLEASE READ INFO AT PAGE BUTTON!!!
  " This page should always used be as entry point into application.
  " Copy this page into your BSP application, and change line below.
  DATA: target_page TYPE STRING VALUE 'index.htm'.
  DATA: frame       type string.
  frame = sy-uzeit.
%>
<html>
<script language="JavaScript">

<%= runtime->GET_DOMAIN_RELAX_SCRIPT( ) %>
// Delete the cookie with the specified name.
function DelSso2Cookie(sName,sPath)
{
    var sso2Domain = location.hostname;
    if (location.hostname.indexOf(".")>0)
        sso2Domain = location.hostname.substr(location.hostname.indexOf(".")+1);
    p="";
    if(sPath)p=" path="+sPath+";";
        document.cookie = sName+"=0; expires=Fri, 31 Dec 1999 23:59:59 GMT;"+p + "domain="+sso2Domain+";";
}
function exitBSPApplication(newTargetUrl)
{
<%
  if runtime->session_manager->is_running = 0.
%>
img=new Image;
img.src = document.location.href+"/1x1.gif?sap-contextid=<%= cl_http_utility=>escape_url( runtime->server->session_id )%>&sap-sessioncmd=CANCEL";
<%
    " If you want to destroy the SSO2 cookie along with the server session,
    " please uncomment the function below
%>
//DelSso2Cookie("MYSAPSSO2","/");
for(i=0;i<5000;i++)for(e in document.all) tmp=e.innerHTML;
<%
  endif.
%>
    document.getElementById("<%= frame%>_FRAMESET").onunload = null;
    if(newTargetUrl) window.setTimeout('{document.location.href="'+newTargetUrl+'";}', 750);
}
</script>
<frameset id="<%= frame%>_FRAMESET" rows="*,0" onUnLoad="exitBSPApplication();" resize="no" framespacing="0" frameborder="0">
    <frame name="<%= frame %>_FRAME" src="<%= target_page%>" >
    <noframes>This browser does not support frames.</noframes>
</frameset>
</html>

Sorry for this beginner question but I´m new to BSP.

Thank you for any advice

replied

try this

<% data: temp_url type string .

concatenate <currentpageurl> '&sap-sessioncmd=close&sap-exiturl=' 'default.htm' into temp_url . %>

<htmlb:button id = "logout"

text = "Log Off"

onClientClick = "javascript:window.open ('<%= temp_url %>', '_top' />

Regards

Raja

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question