FM 'PF_READ_STAT_REC'

I want to use this FM to read the statistic record in STAT file, but not all the records in the file, only those for some specific users.
I see there is an import parameter of this FM, that is 'USER', is this parameter designed for this purpose? I tried to test this FM with parameter, but failed to get the right record.
How about another parameter 'READ_MODE', what's this used for?
Is there anyone aware of this kind of thing? Any tips would be appreacited.

Hi Yuri,
thank you for the quick reply.
I was using SWNC_GET_STATRECS_FRAME function module and as you mentioned SWNC_STAD_READ_STATRECS
both are using same internal function module PF_READ_STAT_REC
calling kernel
read the statrec with the kernel C-call
  CALL 'PfCall' ID 'OPCODE' FIELD PF_OPCODE_READ_REC
Is there any particular change in SAP Release 701 <SAP kernel....... 701  > because this shortdump is happening only in this version.
Thankyou once again.

Similar Messages

  • Abap reports:  Detecting who uses and how often

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

    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.

Maybe you are looking for

  • Inventory report for the selection of requisitioner and MRP controller

    Hello Experts,                        Can someone please help me with a standard  Inventory report in which we can give input thr requistioner and MRP controller regards, YK

  • Error while opening Navigation setting is SharePoint 2013

    Unable to View negation bar and Also unable to open NavigationSettings in the site Setting. An error occured while rendering navigation for requested URL: /sites/PerformanceManagement. Exception message: Cannot open "/sites/PerformanceManagement/AFAQ

  • Siebel 8.0 Out bound communication manager error message failure

    We are consistenly seeing this error in the S_COM_REQ table and couldn't find a real reason why Sent 0 out of 0 messages. Cannot open request state file Cannot open request state file CommOutboundMgr1-7V2P4J.CommOutboundMgr.crf, error 1., error <?>.(

  • FCP X opens but no window appears?

    Upon clicking FCP X, the icon jumps up and down, but then stops, but then no windows appear? Not even the little start up one. Any help?

  • Error in posing question?

    I have been trying to submit a question for days.  First it just plain disappeared.  Now I'm getting an error message with no explanation.  Has microsoft taken over this site?