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

FM to logoff user sessions TH_DELETE_USER


We have a requirement to develop a report program which should log off all the sessions of a specific user. We tried to use the standard FM 'TH_DELETE_USER' for this functionality but we are getting 'AUTHORITY_ERROR' when we execute this FM.

If anybody has worked on this FM and knows how to use the FM to satisfy the requirement please let us know or any other suggestions which can help us in loging off the users will be of great help.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Apr 27, 2011 at 12:02 PM


    first you need a user who has this administration authorities.

    Then you have to get some informations about servers and users, e.g.:

    *    Get server list
    call function 'RFC_GET_LOCAL_DESTINATIONS'
          localdest     = xt_server
          not_available = 1
          others        = 2.
                                                                                    check sy-subrc          eq  0.
                                                                                    refresh                     xt_users.
                                                                                    loop                    at  xt_server.
        refresh                   xt_usrvr.
                                                                                    call function 'THUSRINFO'
          destination xt_server
            usr_tabl = xt_usrvr
            others   = 4.
        if  sy-subrc          eq  0.
          loop                at  xt_usrvr.
            if xt_usrvr-bname in  xp_uname.
              xt_users-bname  =  xt_usrvr-bname.
              xt_users-tid    =  xt_usrvr-tid.
              xt_users-apserver  =  xt_server.
              append             xt_users.
          message  w999(zz) with  text-m00
                                                                                    *    SORT list
      sort                        xt_users
                              by  bname
                                                                                    *    delete duplicates
      delete  adjacent duplicates from xt_users
                       comparing  bname

    At least you have to logoff the user

    call function 'TH_DELETE_USER'
        destination xt_users-apserver
          user            = xt_users-bname
          client          = sy-mandt
          authority_error = 1
          others          = 2.



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 27, 2011 at 12:03 PM

    Why not speak to your security admin about the "authority error". It seems rather obvious that the user executing the process doesn't have the necessary authorization to perform the "delete".

    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.