cancel
Showing results for 
Search instead for 
Did you mean: 

Customer exit SUSR0001 to log off invalid user

bharath_padmanabhan
Participant
455

Experts,

I have 2 shifts of employees(first and second shift). I created 2 TPARA parameters(ZSHIFT1 and ZSHIFT2 and assigned it to user profile in SU01. I have maintained the working hours for these 2 shifts. In exit SUSR0001, I have written code to check if the current login time of the employee is within his shift hours or not. If its outside his shift hours, I am using popup TH_POPUP to show a message which says "You can't login outside your shift hours" and then using FM SYST_LOGOFF, I am logging off the user. 

        CALL FUNCTION 'TH_POPUP'
          EXPORTING
            client         = sy-mandt
            user           = sy-uname
            message        = lv_message
          EXCEPTIONS
            user_not_found = 1
            OTHERS         = 2.
        WAIT UP TO 10 SECONDS.
        IF sy-subrc EQ 0.
          CALL 'SYST_LOGOFF'.
        ENDIF.

This works fine. But there are a few smart users, who click the top left corner in the SAP screen and choose stop transaction. So the wait step for 10 seconds (which we added to allow the users to read the pop up message) gets cancelled and the user instantly gets access to the system. 

In our forum, I could see similar requirements like restricting an user to only login for a single terminal. I see that everyone has suggested the exit name but don't find how we can bypass this backdoor entry using stop transaction trick.

Can you please share your inputs if its feasible to kind of freeze or prevent users from clicking anywhere while the popup is displayed so that they will get logged off in 10 seconds?

Thanks

Bharath

Accepted Solutions (0)

Answers (0)