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

Need the Table for User Ids

pankajs_dwivedi
Participant
0 Likes
1,201

Hi,

I need the table where the userid's of the users currently logged into the client. Any pointers on this

Hi,

I need the table where the userid's of the users currently logged into the client. Any pointers on this

8 REPLIES 8
Read only

Former Member
0 Likes
1,135

CHECK...<b>USR02</b>

ALSO CHECK SM04 and double click on the user id, it will tell you those details

Read only

Former Member
0 Likes
1,135

You can do something like this :

data :

BEGIN OF t_user OCCURS 0,

counter TYPE i,

selection TYPE c,

mandt LIKE sy-mandt,

bname LIKE sy-uname,

name_first LIKE v_adrp_cp-name_first,

name_last LIKE v_adrp_cp-name_last,

department LIKE v_adrp_cp-department,

tel_number LIKE v_adrp_cp-tel_number,

END OF t_user,

l_client LIKE sy-mandt,

l_userid LIKE uinfo-bname,

l_opcode TYPE x,

l_funct_code(1) TYPE c,

l_test(200) TYPE c.

l_opcode = 2.

CALL 'ThUsrInfo' ID 'OPCODE' FIELD l_opcode

ID 'TAB' FIELD usr_tabl-sys.

CLEAR t_user. REFRESH t_user.

LOOP AT usr_tabl.

t_user-mandt = usr_tabl-mandt.

t_user-bname = usr_tabl-bname.

APPEND t_user.

ENDLOOP.

SORT t_user.

DELETE ADJACENT DUPLICATES FROM t_user.

LOOP AT t_user.

t_user-counter = sy-tabix.

SELECT v~name_first

v~name_last

v~department

v~tel_number

INTO (t_user-name_first,

t_user-name_last,

t_user-department,

t_user-tel_number)

FROM usr21 AS u

JOIN v_adrp_cp AS v

ON upersnumber = vpersnumber AND

uaddrnumber = vaddrnumber

WHERE u~bname = t_user-bname.

ENDSELECT.

MODIFY t_user.

ENDLOOP.

SORT t_user BY name_last name_first.

table t_user now contains all the user details

Read only

Former Member
0 Likes
1,135

hi,

check the table USR22 or USR02.

Read only

anversha_s
Active Contributor
0 Likes
1,135

hi,

1. use the FM TH_SYSTEMWIDE_USER_LIST

2. Not only the user list,

u will also get the

terminal, various tcodes,

they are currently using.

for any clarifiaction pls mail me.

pls reward points, if this helped u.

regards,

anversha.

[email protected]

Read only

former_member404244
Active Contributor
0 Likes
1,135

Hi Pankaj,

u can use the FM TH_SYSTEMWIDE_USER_LIST ,also u can use the table USR02.

regards,

nagaraj

Read only

Former Member
0 Likes
1,135

Hi,

there's a function module called TH_USER_LIST in R/3 you can use for this. It'll return the list of users logged in.

Regards,

Ram

Pls reward points if helpful.

Read only

Former Member
0 Likes
1,135

use FM TH_USER_LIST

checkout this program also RSDSUSER

Read only

Former Member
0 Likes
1,135

Hllo Pankaj,

In table <b>USR41</b> itself you can find the user id of the users who are currently logged in.

The field is <b>BNAME</b>.

Thanks,

Krishnakumar