Application Development 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: 

Delete all the user connected to one transaction.

Former Member
0 Kudos

During some periods, we need to lock some transaction to avoid user modify data while we are processing some critical jobs.

If the users are yet in the transaction when we lock the transaction they are not removed from the transaction and we need to kill them manually from SM04 transaction in each application server.

I have been trying to adapt the RSM04000_ALV program to do this but i'm stuck with the use of the pooled session.

I guess that the system when you select the session and click on end session, it mark in anyplace something to indicate to the fuction module TH_DELETE_USER that when the option ONLY_POOLED_USER is enable, only that session need to be killed.

Anybody know how this works? someone have a similar fuctionality in you system?

1 REPLY 1

Former Member
0 Kudos

Hello

Try this:


  DATA: BEGIN OF SERVER_LIST OCCURS 0.
          INCLUDE STRUCTURE MSXXLIST.
  DATA: END OF SERVER_LIST.
  DATA: BEGIN OF USER_LIST OCCURS 0.
          INCLUDE STRUCTURE UINFO.
  DATA: END OF USER_LIST.
  DATA: BEGIN OF USER_LIST1 OCCURS 0.
          INCLUDE STRUCTURE UINFO.
  DATA: END OF USER_LIST1.

  DATA: USER_TERM LIKE RFCDISPLAY-RFCHOST.

  CALL FUNCTION 'TH_SERVER_LIST'
       TABLES
            LIST   = SERVER_LIST
       EXCEPTIONS
            OTHERS = 1.
  LOOP AT SERVER_LIST.
    CALL FUNCTION 'TH_USER_LIST'
         DESTINATION SERVER_LIST-NAME
         TABLES    LIST = USER_LIST1.
    APPEND LINES OF USER_LIST1 TO USER_LIST.
    REFRESH USER_LIST1.
    LOOP AT USER_LIST WHERE TCODE = 'YOUR T-CODE'.
            CALL FUNCTION 'TH_DELETE_USER' DESTINATION SERVER_LIST-NAME
             EXPORTING
                USER            = USER_LIST-BNAME
                CLIENT          = SY-MANDT
                TID             = USER_LIST-TID
             EXCEPTIONS
                AUTHORITY_ERROR = 1
                OTHERS          = 2.
    ENDLOOP.
  ENDLOOP.