Application Development and Automation 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: 
Read only

sap sm04 functionality

Former Member
0 Likes
741

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

4 REPLIES 4
Read only

Former Member
0 Likes
572

the best thing is try to post the question in BASIS forum.....

Read only

0 Likes
572

Hi ,

Please my help on this issue.

Thanks

mohan

Read only

0 Likes
572

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

Read only

Former Member
0 Likes
572

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....