Skip to Content
author's profile photo Former Member
Former Member

I want to restrict the number of simultaneous logons for a particular user.

Hi,

I want to restrict the number of simultaneous logons for a particular user.

Eg: if maximum 3 simultaneous logons for user u2018USER1u2019 is permissible, so when the forth user logs into the system, error message u2018Maximum logons reached for user IDES. Please wait till somebody logs outu2019 should be displayed.

There is an enhancement 'SUSR0001' which I am using to do so.

I have created a Z-table wherein I have defined the maximum no. of simultaneous logons for different users.

It works. But the problem is that after the error message is displayed and the user enters '/n' in the command field, the SAP Easy Access Screen gets displayed. This should not happen.

Below is the source code:

TABLES: ZUSR41.

DATA: INT41 LIKE USR41 OCCURS 10 WITH HEADER LINE.

CHECK: SY-UNAME <> 'SAP*'.

SELECT SINGLE * FROM ZUSR41 INTO ZUSR41 WHERE BNAME = SY-UNAME.

SELECT * FROM USR41 INTO TABLE INT41 WHERE BNAME = SY-UNAME.

IF ZUSR41-BNAME NE SPACE.

IF ZUSR41-LOGINS NE '0'.

CHECK: SY-DBCNT GT ZUSR41-LOGINS.

MESSAGE E398(00) WITH 'Maximum logins reached for' SY-UNAME 'Please wait till somebody logs out'.

ENDIF.

ENDIF.

The error message is displayed but the user can still logon by entering '/n' in the command prompt.

How can I stop this?

I also used 'Leave Program' but that too displayed SAP Easy Access Screen.

Please assist....

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jan 14, 2009 at 03:32 PM

    If that doesn't work, try function module TH_DELETE_MODE.

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 14, 2009 at 03:30 PM

    Hi,

    try to put this instruction in the exit.

    CALL 'SYST_LOGOFF'.

    In the early verisions it worked well. Let us know.

    Hope it helps

    Bye

    Andrea

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 15, 2009 at 09:08 AM

    If you read the documentation for the FM 'SUSR_LOGON_USER_EXIT' it says.

    Programmers are able to make additional checks and send additional messages after user logon. Please don't implement

    • - a logoff of the user

    • - an error message

    • - too many popups

    Its better to take help of Basis

    Edited by: Abhishek Jolly on Jan 15, 2009 10:09 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2009 at 05:42 AM

    -

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.