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

ALV user Tracking Report

Former Member
0 Likes
1,019

Hi experts,

can any body tell me how can i make a ABAP ALV Report which give number of user login in into the system for how long time with all details based on the user specified date,username,tcode and time on selection screen

for example -


.user name,time,tcode,tables,anything that used by user on that specified date

Regards,

imran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
960

Hi Imran

If ur problem is solved then dont forget to close ur thread

Regards

Pavan

Hi experts,

can any body tell me how can i make a ABAP ALV Report which give number of user login in into the system for how long time with all details based on the user specified date,username,tcode and time on selection screen

for example -


.user name,time,tcode,tables,anything that used by user on that specified date

Regards,

imran

7 REPLIES 7
Read only

Former Member
0 Likes
960

please give table name if posible

Read only

0 Likes
960

Hi,

Just search the program starting with RSUSR and table starting with USR.

Reward points if useful.

Regards,

Atish

Read only

0 Likes
960

Hi Imran

<u><b>

I think yesterday i had given u the coding of the alv grid which displays the list of users

ok refer to this code and follow what i say so that u can get the list of users</b></u>

In this U have to create an Table with the following fields. In this program i had created a table with the name

<b>ZSAPUSERS</b>

In which u have to include the following fileds

<b>ZUSER</b> <u><b>Name of the User.</b></u>

<b>TCODE</b> <u><b> Transaction.</b></u>

<b>SERVER</b> <u><b>Name of The Server.</b></u>

<b>TERMID</b> <u><b>Terminal ID working from</b></u>


*&---------------------------------------------------------------------*
*& Report  ZALV_LIST_OF_USERS                                          *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT ZALV_LIST_OF_USERS.
TABLES: ZSAPUSERS.
type-pools slis.

DATA: ITAB TYPE ZSAPUSERS OCCURS 0 WITH HEADER LINE,
      TEMP TYPE I.

DATA: INT_FCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: i_repid like sy-repid, SDATE TYPE SY-DATUM.
DATA: TITLE(50) TYPE C.
DATA: STR TYPE ZSAPUSERS-ZUSER.
DATA: LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: DATELOW(10) TYPE C,
      DATEHIGH(10) TYPE C.
DATA: TOP_OF_PAGE      TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
DATA: TOP_OF_LIST     TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST'.
DATA: V_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
DATA: EVENTS           TYPE SLIS_T_EVENT.

***************************************************************

SDATE = SY-DATUM - 1.

SELECTION-SCREEN BEGIN OF BLOCK SR WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS ZVUSER FOR ZSAPUSERS-ZUSER DEFAULT '*' OBLIGATORY no
INTERVALS no-extension.

SELECT-OPTIONS ZTCODE FOR ZSAPUSERS-TCODE no INTERVALS
no-extension.

SELECT-OPTIONS ZVDATE for ZSAPUSERS-ZDATE.
SELECTION-SCREEN END OF BLOCK SR.

PERFORM GET_EVENTS.


START-OF-SELECTION.

  MOVE: 'I'      TO ZVUSER-SIGN,
        'CP'     TO ZVUSER-OPTION,
         ZVUSER-LOW  TO ZVUSER-LOW.
  APPEND ZVUSER.

*  MOVE: 'I'      TO ZTCODE-SIGN,
*        'CP'     TO ZTCODE-OPTION,
*         ZTCODE  TO ZTCODE-LOW.
*  APPEND ZTCODE.

  i_repid = sy-repid.

  IF ZTCODE-LOW EQ ''.

    SELECT * INTO TABLE ITAB FROM ZSAPUSERS WHERE ( ZDATE IN
    ZVDATE AND ZUSER IN ZVUSER ) ORDER BY RECID.

  ELSE.

    SELECT * INTO TABLE ITAB FROM ZSAPUSERS WHERE ( ZDATE IN
    ZVDATE AND ZUSER IN ZVUSER ) AND ( TCODE IN ZTCODE ) ORDER BY RECID.

  ENDIF.
  DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ZUSER TCODE SERVER
  TERMID.

  PERFORM COMMENT_BUILD  USING LISTHEADER[].

  DESCRIBE TABLE ITAB LINES TEMP.
  TITLE = 'Displays SAP Users list, No. of Records : '.
  SET TITLEBAR 'TITLEBAR' WITH TITLE TEMP.
  PERFORM INIT_FIELDCAT.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM      = i_repid
      i_callback_user_command = 'USER_COMMAND'
      I_STRUCTURE_NAME        = 'ZSAPUSER'
      IT_FIELDCAT             = int_fcat[]
      it_events               = EVENTS[]
    TABLES
      T_OUTTAB                = ITAB
    EXCEPTIONS
      program_error           = 1
      others                  = 2.

*&--------------------------------------------------------------------*
*&      Form  INIT_FIELDCAT
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
FORM INIT_FIELDCAT.
  DATA: POS TYPE I VALUE 1.
  DATA: M_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

* Header Details.
  CLEAR M_FIELDCAT.
  M_FIELDCAT-COL_POS       =  POS.
  M_FIELDCAT-FIELDNAME     = 'RECID'.
  M_FIELDCAT-SELTEXT_M     = 'RECORD ID'.
  M_FIELDCAT-HOTSPOT       = ''.
  M_FIELDCAT-TABNAME       =  'ITAB'.
  M_FIELDCAT-OUTPUTLEN = ''.
  APPEND M_FIELDCAT TO INT_fcat.
  POS = POS + 1.

  CLEAR M_FIELDCAT.
  M_FIELDCAT-COL_POS       =  POS.
  M_FIELDCAT-FIELDNAME     = 'ZDATE'.
  M_FIELDCAT-SELTEXT_M     = 'START DATE'.
  M_FIELDCAT-HOTSPOT       = ''.
  M_FIELDCAT-TABNAME       =  'ITAB'.
  M_FIELDCAT-OUTPUTLEN = ''.
  APPEND M_FIELDCAT TO INT_fcat.
  POS = POS + 1.

  CLEAR M_FIELDCAT.
  M_FIELDCAT-COL_POS       =  POS.
  M_FIELDCAT-FIELDNAME     = 'TIME'.
  M_FIELDCAT-SELTEXT_M     = 'TIME'.
  M_FIELDCAT-HOTSPOT       = ''.
  M_FIELDCAT-TABNAME       =  'ITAB'.
  M_FIELDCAT-OUTPUTLEN = ''.
  APPEND M_FIELDCAT TO INT_fcat.
  POS = POS + 1.

  CLEAR M_FIELDCAT.
  M_FIELDCAT-COL_POS       =  POS.
  M_FIELDCAT-FIELDNAME     = 'ZUSER'.
  M_FIELDCAT-SELTEXT_M     = 'USER'.
  M_FIELDCAT-HOTSPOT       = ''.
  M_FIELDCAT-TABNAME       =  'ITAB'.
  M_FIELDCAT-OUTPUTLEN = ''.
  APPEND M_FIELDCAT TO INT_fcat.
  POS = POS + 1.

  CLEAR M_FIELDCAT.
  M_FIELDCAT-COL_POS       =  POS.
  M_FIELDCAT-FIELDNAME     = 'TCODE'.
  M_FIELDCAT-SELTEXT_M     = 'TRANS ID'.
  M_FIELDCAT-HOTSPOT       = ''.
  M_FIELDCAT-TABNAME       =  'ITAB'.
  M_FIELDCAT-OUTPUTLEN = ''.
  APPEND M_FIELDCAT TO INT_fcat.
  POS = POS + 1.

  CLEAR M_FIELDCAT.
  M_FIELDCAT-COL_POS       =  POS.
  M_FIELDCAT-FIELDNAME     = 'SERVER'.
  M_FIELDCAT-SELTEXT_M     = 'SERVER NAME'.
  M_FIELDCAT-HOTSPOT       = ''.
  M_FIELDCAT-TABNAME       =  'ITAB'.
  M_FIELDCAT-OUTPUTLEN = ''.
  APPEND M_FIELDCAT TO INT_fcat.
  POS = POS + 1.

  CLEAR M_FIELDCAT.
  M_FIELDCAT-COL_POS       =  POS.
  M_FIELDCAT-FIELDNAME     = 'TERMID'.
  M_FIELDCAT-SELTEXT_M     = 'TERMINAL ID'.
  M_FIELDCAT-HOTSPOT       = ''.
  M_FIELDCAT-TABNAME       =  'ITAB'.
  M_FIELDCAT-OUTPUTLEN = ''.
  APPEND M_FIELDCAT TO INT_fcat.
  POS = POS + 1.

ENDFORM.                    "INIT_FIELDCAT

*&--------------------------------------------------------------------*
*&      Form  COMMENT_BUILD
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
*      -->LT_TOP_OF_Ptext
*---------------------------------------------------------------------*
FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
  DATA: LS_LINE TYPE SLIS_LISTHEADER.
  data: tempstr(255) type c.
  write zvDATE-LOW to DATELOW DD/MM/YYYY.
  write zvDATE-HIGH to DATEHIGH DD/MM/YYYY.

  CLEAR LS_LINE.
  LS_LINE-TYP  = 'H'.
  concatenate 'Searching User : ' zvuser-low ' and Tcode : ' ztcode-low
  into tempstr.
  LS_LINE-INFO = tempstr.
  APPEND LS_LINE TO LT_TOP_OF_PAGE.

  CLEAR LS_LINE.
  LS_LINE-TYP  = 'S'.
  LS_LINE-KEY  = 'FROM DATE : '.
  LS_LINE-INFO = DATELOW.
  APPEND LS_LINE TO LT_TOP_OF_PAGE.
  LS_LINE-TYP  = 'S'.
  LS_LINE-KEY  = 'TO DATE : '.
  LS_LINE-INFO = DATEHIGH.
  APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDFORM.                    "COMMENT_BUILD


*&--------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
FORM TOP_OF_PAGE.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = LISTHEADER.
ENDFORM.                    "TOP_OF_PAGE

*&--------------------------------------------------------------------*
*&      Form  GET_EVENTS
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
FORM GET_EVENTS.

  DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      I_LIST_TYPE = 0
    IMPORTING
      ET_EVENTS   = EVENTS.
  READ TABLE EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                                    INTO LS_EVENT.
  IF SY-SUBRC = 0.
    MOVE TOP_OF_PAGE TO LS_EVENT-FORM.
    APPEND LS_EVENT TO EVENTS.
  ENDIF.

ENDFORM.                    " GET_EVENTS

If u finf any difficulties or any problem let me know to clear ur doubt

Reward if helpfull

Regards

Pavan

Read only

0 Likes
960

Hi Pavan

I am also in need of a report which shows all the user t code with HR,SD,MM,PP Is there any way to do it

Monto

Read only

Former Member
0 Likes
960

Hi,

refer to this program RSUSR000.

No need to write your own program there are lots of standard program which can solve your problem.

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
960

Hi

Use the Table <b>USR02</b> for LOG on details of all users

amnd see the other tables like

<b>USR01,03,04,05,10,12,13,11 etc</b> for further details

Also use the tables

<b>AGR_users

AGR_TCODES

UST12

AGR_1252, 1250

and other AGR* tables</b> for the required data

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
961

Hi Imran

If ur problem is solved then dont forget to close ur thread

Regards

Pavan