Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member182466
Contributor

The inconvenience


In many SAP systems a time-out is set so you will be logged out automatically after a certain time without any activity. This is a nice security feature, but when the time out is short it becomes a problem in some development scenarios. Especially where the development needs to be done in one client and the testing in another it is pretty easy to time out in the development client while performing some tests. When this happens you will lose all unsaved data. Now I know that it is always a good habit to press Ctrl+S often but wouldn't it be nice if you did not have to worry about this?

The solution


From my experience it is difficult to convince the people that determine these time-outs to remove it for the development client. So, to keep my session in the development client alive I wrote the little program below. It uses the fact that an update of the progress indicator creates a round-trip to the presentation server and resets the time-out counter. The call to TH_CREATE_MODE first opens a new session before the current session enters the endless loop that continuously resets the timer.

REPORT zno_more_timeout.
START-OF-SELECTION.
CALL FUNCTION 'TH_CREATE_MODE'.
DO.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = 50
text = 'doing nothing'.
WAIT UP TO 60 SECONDS.
ENDDO.

I tied this program to a transaction and added it to my Favorites in me SAP menu. Now, any time I logon to the development client the first thing I do is double click this favorite and continue working in the new session it generates. This method does eat up a session but the security that a time-out will never destroy any of my work makes this small sacrifice well worth it.