‎2007 Apr 11 4:42 PM
Hi ,
The Below is the program right now I am using for the sm04 functionality , it is working fine , But my objective is , on the slection- screen , <b>when user enters tcode it should pick all the users who are working on that server and kill that tcode(like end session functionality)</b> , before closing the all users tcode, we should send a message to them and after executing the program it should display message successfully killed all users tcode.
Please help me on this task ..
tables : tstc,usr02.
data : th_opcode(1) type x.
data: strtid(10).
constants : opcode_user_list like th_opcode value 2,
opcode_mode_count like th_opcode value 3,
opcode_long_usr_info like th_opcode value 32,
opcode_delete_usr like th_opcode value 25,
opcode_delete_trans_id like th_opcode value 45.
data : opcode_delete_mode like th_opcode value 24.
data: begin of lt_usgrp occurs 0.
include structure usgrp.
data: end of lt_usgrp.
data : itab_all_users like uinfo occurs 0 with header line.
data : itab_all_xn like uinfo2 occurs 0 with header line.
data : itab_user_xn like uinfo2 occurs 0 with header line.
data: v_tabix type sy-tabix.
data: tid type i,
modes like sy-index.
data params like pri_params.
data: days(1) type n value 2,
count(3) type n value 1,
valid type c.
data: title like pri_params-prtxt.
data temp_text like sm04dic-popupmsg.
selection-screen begin of block b1 with frame. "TITLE TEXT-001.
Define Transactions
select-options: s_xncode for tstc-tcode obligatory.
selection-screen skip.
Define User groups
select-options: s_grp for usr02-class.
Warn User Before Kicking Off?
selection-screen skip 1.
parameters : warnuser as checkbox.
selection-screen end of block b1.
clear : itab_user_xn,
itab_all_users,
itab_user_xn.
refresh : itab_user_xn,
itab_all_users,
itab_user_xn.
*Get list of all users
call 'ThUsrInfo' id 'OPCODE' field opcode_user_list
id 'TAB' field itab_all_users-sys.
call function 'POPUP_WITH_TABLE_DISPLAY'
exporting
endpos_col = 100
endpos_row = 50
startpos_col = 10
startpos_row = 10
titletext = 'Users list'
importing
choise = v_tabix
tables
valuetab = itab_all_users
EXCEPTIONS
BREAK_OFF = 1
OTHERS = 2
.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
read table itab_all_users index v_tabix.
tid = itab_all_users-tid.
write tid to strtid left-justified.
set parameter id 'TID' field strtid.
call 'ThUsrInfo' id 'OPCODE' field opcode_mode_count
id 'TID' field tid
id 'MODES' field modes.
modes = modes + 7.
call screen 2000 starting at 4 4 ending at 62 modes.
endif.
Thanks
Mohan
‎2007 Apr 11 4:47 PM
the best thing is try to post the question in BASIS forum.....
‎2007 Apr 11 6:01 PM
‎2007 Apr 11 7:28 PM
Hey Ramesh...
The basis guys had already infomed that there is no functionality as such on which they can help us...so i think we need to do using ABAP...
Kommi
‎2008 Mar 10 5:34 AM
HI ,
I am new to SAP . IF u have got the solution for this can u mail me on maheshnaik85@gmail.com
even I am trying to do this ...for learnig....