Session Time out warning message on UI
Sometimes one may get a requirement such as to produce a pop-up message on UI 5 minutes from timeout, so as to intimate the user to perform some activity to avoid session timeout.
Now the challenge here is that in order to trigger a pop-up there has to be an event. In the absence of any event trigger, this becomes a challenge to perform this using only ABAP.
var c=4200; <%– session time out pop up time –%>
if (c == ‘0’)
alert(“Your session will time out in 5 minutes”) ;
c = 4200; <%– session time out pop up time –%>
Here, the variable ‘c’ contains the value of the session timeout popup in seconds. Now, this value can be caught from the system constant for session time out time. The code above is quite simple but the point to be noted here is the call to ‘thtmlbRegisterOnLoad’. This resets the counter on any user action. Since, all of the UI content is placed in Iframes so resetting the counter on ‘bodyonload’ works only the first time the page is loaded.
How I found out the ‘thtmlbRegisterOnLoad’ event : View->source of the page and then searched for any ‘load’ keyword.
This was my first blog. I hope consultants will find it helpful. In my next blog I’ll describe how to launch a GUI transaction on UI , on a custom button click.