Application Development 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: 

Abap reports: Detecting who uses and how often

0 Kudos

Our company has been live with R/3 since 1996, and has accumulated a lot of custom ABAP reports. When we next upgrade or apply support packs, I'd like to be able to retire the unused reports, and find out who used the rarely-used ones.

Ideally, SAP 4.6c already has a tool which detects starts via 'submit', SE38, SA38, or transaction code.

Does anyone know of such a tool?

(We have a product called Luminate, but didn't buy the ad-hoc reporting part I need. I also looked at SAP's RBE, but it's currently unavailable.)

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Eric,

You can write your own code which will give you are the information from the STAT file.

You can also run STAT - System Statistics to get the info. We have written a simple code which does 3 steps mentioned below. We read the info from the STAT file and store in the z table.

NOTE: you can use this code only if your system has been enabled for collecting STAT info.

  PERFORM startofsel_open_stat_file.
  PERFORM startofsel_read_data_from_stat.
  PERFORM startofsel_close_stat_file.

FORM startofsel_open_stat_file .

  CALL FUNCTION 'PF_FLUSH_BUFFER'.
  CALL FUNCTION 'PF_OPEN_STAT_FILE'.

ENDFORM.                    " startofsel_open_stat_file

FORM startofsel_read_data_from_stat.

  CLEAR: it_pgrmstats_1,
         it_newstats.

  REFRESH: it_pgrmstats_1,
           it_newstats.

  CALL FUNCTION 'PF_READ_STAT_REC'
       EXPORTING
            file              = w_local_fname
            target_rec_no     = 0  "READ FIRST REC
       IMPORTING
            diarec            = w_diarec
            btcrec            = w_btcrec
            rfccdrec          = w_rfccdrec
            rfcsdrec          = w_rfcsdrec
            rectype           = w_rectype
            recno             = w_recno
       EXCEPTIONS
            pf_end_of_file    = 1
            pf_internal_error = 2
            OTHERS            = 3.

  CHECK sy-subrc = 0.

  SELECT *
    FROM zgbsstats
    INTO TABLE it_pgrmstats_1.
*    WHERE PGRMNAME IN S_PROG .
*      AND DEVCLASS IN S_DEVCLS
*      AND edate    IN s_date
*      AND USERID   IN S_USER.

  IF sy-subrc EQ 0.
    SORT it_pgrmstats_1 BY pgrmname.
  ENDIF.

  PERFORM process_stat_record.

  DO.
    CALL FUNCTION 'PF_READ_STAT_REC'
         EXPORTING
              file              = w_local_fname
         IMPORTING
              diarec            = w_diarec
              btcrec            = w_btcrec
              rfccdrec          = w_rfccdrec
              rfcsdrec          = w_rfcsdrec
              rectype           = w_rectype
              recno             = w_recno
         EXCEPTIONS
              pf_end_of_file    = 1
              pf_internal_error = 2
              OTHERS            = 3.

    IF sy-subrc = 0.
      PERFORM process_stat_record.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.
ENDFORM.                    "startofsel_read_data_from_stat


FORM startofsel_close_stat_file .

  CALL FUNCTION 'PF_CLOSE_STAT_FILE'.

ENDFORM.                    " startofsel_close_stat_file


FORM process_stat_record.

  CLEAR: it_newstats.

  CASE w_rectype.

    WHEN '00'. "On-line programs
      CHECK NOT w_diarec-cuafunc = 'BACK'.
      MOVE w_diarec-report  TO it_newstats-pgrmname.
      MOVE w_diarec-tcode   TO it_newstats-tcode.
      MOVE w_diarec-account TO it_newstats-userid.
      MOVE w_diarec-date    TO it_newstats-edate.

    WHEN '01'. "Batch Jobs
      MOVE w_btcrec-report  TO it_newstats-pgrmname.
      MOVE w_btcrec-jobname TO it_newstats-jobname.
      MOVE w_btcrec-account TO it_newstats-userid.
      MOVE w_btcrec-date    TO it_newstats-edate.

    WHEN '05'. "RFC
      MOVE w_rfccdrec-progname TO it_newstats-pgrmname.
      MOVE w_rfccdrec-funcname TO it_newstats-functname.
      MOVE w_rfccdrec-userid   TO it_newstats-userid.
      MOVE w_rfccdrec-rfcstart(8) TO it_newstats-edate.

    WHEN '06'.
      MOVE w_rfcsdrec-progname TO it_newstats-pgrmname.
      MOVE w_rfcsdrec-funcname TO it_newstats-functname.
      MOVE w_rfcsdrec-userid   TO it_newstats-userid.
      MOVE w_rfcsdrec-rfcstart(8) TO it_newstats-edate.

  ENDCASE.

  IF NOT it_newstats           IS INITIAL
     AND it_newstats-edate     IN s_date
     AND it_newstats-pgrmname  IN s_prog
     AND it_newstats-userid    IN s_user.

    APPEND it_newstats.

  ENDIF.

ENDFORM.                    "process_stat_record

Cheers

VJ

If it helps dont forget to mark points.

7 REPLIES 7

Former Member
0 Kudos

You could use transation STAD for the same.

Award points if helpful.

Former Member
0 Kudos

There is no standard place in SAP where we can find that info. We had similar issue and we resolved it in the following way.

We included a common function module in all the reports.

This function module inserts a record in a Z table with the user who accessed it and functional area of the report. We analyzed the table after one year and removed unsued programs.

Hope this helps.

Former Member
0 Kudos

Hi Eric,

You can write your own code which will give you are the information from the STAT file.

You can also run STAT - System Statistics to get the info. We have written a simple code which does 3 steps mentioned below. We read the info from the STAT file and store in the z table.

NOTE: you can use this code only if your system has been enabled for collecting STAT info.

  PERFORM startofsel_open_stat_file.
  PERFORM startofsel_read_data_from_stat.
  PERFORM startofsel_close_stat_file.

FORM startofsel_open_stat_file .

  CALL FUNCTION 'PF_FLUSH_BUFFER'.
  CALL FUNCTION 'PF_OPEN_STAT_FILE'.

ENDFORM.                    " startofsel_open_stat_file

FORM startofsel_read_data_from_stat.

  CLEAR: it_pgrmstats_1,
         it_newstats.

  REFRESH: it_pgrmstats_1,
           it_newstats.

  CALL FUNCTION 'PF_READ_STAT_REC'
       EXPORTING
            file              = w_local_fname
            target_rec_no     = 0  "READ FIRST REC
       IMPORTING
            diarec            = w_diarec
            btcrec            = w_btcrec
            rfccdrec          = w_rfccdrec
            rfcsdrec          = w_rfcsdrec
            rectype           = w_rectype
            recno             = w_recno
       EXCEPTIONS
            pf_end_of_file    = 1
            pf_internal_error = 2
            OTHERS            = 3.

  CHECK sy-subrc = 0.

  SELECT *
    FROM zgbsstats
    INTO TABLE it_pgrmstats_1.
*    WHERE PGRMNAME IN S_PROG .
*      AND DEVCLASS IN S_DEVCLS
*      AND edate    IN s_date
*      AND USERID   IN S_USER.

  IF sy-subrc EQ 0.
    SORT it_pgrmstats_1 BY pgrmname.
  ENDIF.

  PERFORM process_stat_record.

  DO.
    CALL FUNCTION 'PF_READ_STAT_REC'
         EXPORTING
              file              = w_local_fname
         IMPORTING
              diarec            = w_diarec
              btcrec            = w_btcrec
              rfccdrec          = w_rfccdrec
              rfcsdrec          = w_rfcsdrec
              rectype           = w_rectype
              recno             = w_recno
         EXCEPTIONS
              pf_end_of_file    = 1
              pf_internal_error = 2
              OTHERS            = 3.

    IF sy-subrc = 0.
      PERFORM process_stat_record.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.
ENDFORM.                    "startofsel_read_data_from_stat


FORM startofsel_close_stat_file .

  CALL FUNCTION 'PF_CLOSE_STAT_FILE'.

ENDFORM.                    " startofsel_close_stat_file


FORM process_stat_record.

  CLEAR: it_newstats.

  CASE w_rectype.

    WHEN '00'. "On-line programs
      CHECK NOT w_diarec-cuafunc = 'BACK'.
      MOVE w_diarec-report  TO it_newstats-pgrmname.
      MOVE w_diarec-tcode   TO it_newstats-tcode.
      MOVE w_diarec-account TO it_newstats-userid.
      MOVE w_diarec-date    TO it_newstats-edate.

    WHEN '01'. "Batch Jobs
      MOVE w_btcrec-report  TO it_newstats-pgrmname.
      MOVE w_btcrec-jobname TO it_newstats-jobname.
      MOVE w_btcrec-account TO it_newstats-userid.
      MOVE w_btcrec-date    TO it_newstats-edate.

    WHEN '05'. "RFC
      MOVE w_rfccdrec-progname TO it_newstats-pgrmname.
      MOVE w_rfccdrec-funcname TO it_newstats-functname.
      MOVE w_rfccdrec-userid   TO it_newstats-userid.
      MOVE w_rfccdrec-rfcstart(8) TO it_newstats-edate.

    WHEN '06'.
      MOVE w_rfcsdrec-progname TO it_newstats-pgrmname.
      MOVE w_rfcsdrec-funcname TO it_newstats-functname.
      MOVE w_rfcsdrec-userid   TO it_newstats-userid.
      MOVE w_rfcsdrec-rfcstart(8) TO it_newstats-edate.

  ENDCASE.

  IF NOT it_newstats           IS INITIAL
     AND it_newstats-edate     IN s_date
     AND it_newstats-pgrmname  IN s_prog
     AND it_newstats-userid    IN s_user.

    APPEND it_newstats.

  ENDIF.

ENDFORM.                    "process_stat_record

Cheers

VJ

If it helps dont forget to mark points.

uwe_schieferstein
Active Contributor
0 Kudos

Hello Eric

If you can wait until your release >= 6.20 then SAP provides us with a standard tool for analyzing report usage: it the coverage analyzer (transaction SCOV).

The coverage analyzer does not only count the report usage but goes further to analyze the usage of procedures (i.e. function modules, forms, methods).

Of course, this kind of analysis will slow down the system performance. To which extent I cannot say. However, you can fine tune the coverage analyzer in which packages you want to analyze and how frequent data should be collected (and from which system - RFC is possible).

Regards

Uwe

Former Member
0 Kudos

Hello,

Try with Tcode STAT.

If useful reward.

Vasanth

heiko_hecht
Explorer
0 Kudos

Hi Eric,

there is a tool called RBE Plus which is available as a service and a tool (www.rbe-online.com or www.ibis-thome.com).

Heiko

Former Member
0 Kudos

hi,

Try these transactions.

1.go with STAT and report RSSTATOO.

2.try ST03.(only for 90 days). ST03->click on pe rf DB->hit the target sys and select period-> trans profile.

3.try thesSM19 and SM20 (if you start today no t ee the past).

4. try this STAD.

award points if it is helpful.