Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

User-Exit for Logout

Former Member
0 Likes
1,272

Hello.

Is there a user-exit (like FM SUSR_LOGON_USER_EXIT) that is executed each time a user logs out of the sap system?!

--MIKE

Hello.

Is there a user-exit (like FM SUSR_LOGON_USER_EXIT) that is executed each time a user logs out of the sap system?!

--MIKE

1 REPLY 1
Read only

Former Member
0 Likes
680

Hi Mike;

No there is not, but we use a work-around that may help you. In the log-on user exit that you reference, we store some information such as user-name, terminal, etc. from a function call to 'RFC_SYSTEM_INFO' in a custom table. Then, we call the function BP_EVENT_RAISE to trigger a periodic background job.

data: wf_rfcsi TYPE rfcsi.
* Get the system information, which will include the computer name and
* the IP address of the logon.
  CALL FUNCTION 'RFC_SYSTEM_INFO' DESTINATION 'SAPGUI'
     IMPORTING
       rfcsi_export    = wf_rfcsi.
* Then, store the user name and IP address and terminal name in custom table.

The background job then checks table usr41 with the information in that table to see if the user has logged off. It is certainly not a perfect solution, but it works in our case because we are just trying to trap any super-user log ons (such as DDIC) so we can report the transactions that were executed (SOX) and then lock the user once the log-out occurs.


<select data from custom table>
DO.
* Check tabe USR41 to see if this user has logged off the terminal.
    SELECT SINGLE *
             FROM usr41
             INTO *usr41
             WHERE bname = <username from table>
               AND terminal = <terminal name from table>.
    IF sy-subrc NE 0.
      EXIT.
    ELSE.
* Wait another minute if the user has not logged off.
      WAIT UP TO 60 SECONDS.
    ENDIF.
  ENDDO.

Hope that helps,

John