Saturday, 23 July 2016

SHOW ALL LOGGED IN USER'S NAME .

 


   SHOW ALL LOGGED IN USER NAMES IN ABAP . 

 


REPORT ZALL_LOGGGED_USER.

* Local declarations.
  data:
    lt_usr      like uinfo occurs 10 with header line,
    lt_usr_tabl like uinfo occurs 10 with header line,
    lv_opcode   type x.

* Set operations code.
  LV_OPCODE 2.

* Call kernel.
  call 'ThUsrInfo' id 'OPCODE'  field lv_opcode
                   id 'TAB'     field lt_usr_tabl-*sys*.

* Rearrange and sort.
  loop at lt_usr_tabl-*sys* into lt_usr_tabl.
    move lt_usr_tabl-bname to lt_usr-bname.
    collect lt_usr.
  endloop.
  sort lt_usr.

* Output.
  loop at lt_usr.
    write / lt_usr-bname.
  endloop.

No comments:

Post a Comment