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

  • How to convert an excel "If" formula into a PCR?

    I need to create a rule so that an overpayment recovery is only taken if the net pay is above an agreed amount with the employee. I can write the rule in excel but i'm struggling to convert this into a PCR. All help is welcome even if it's pointing m

  • Keyboard, IR, Trackpad no longer work after 2.1 upgrade

    Installed the BootCamp 2.1 upgrade and after the reboot, the keyboard, trackpad and IR receiver no longer work. Windows recognizes the hardware (Found New Hardware) but during driver install, the dialog box pops up to say that Windows couldn't instal

  • Connect macbook pro to HP laptop [Vista OS]

    Hi All, I am really not all that clued up about things in networking, I was needing to transfer a few files from my macbook pro laptop to a HP laptop. I had hoped to use ethernet as I did not have a large enough flash drive. I connected the 2 laptops

  • My iMovie  is not responding any suggestions

    My Imovie is not responding...any suggestions

  • Reader Extensions Service Empty binary return

    I'm using the ReaderExtensionsService and get a response with a Blob but the binary data is empty. I'm sending the variable blob=base64 just in case and still get no binary data. Any ideas why?