SAP PF_ASTAT_READ_FILE Function Module for









PF_ASTAT_READ_FILE is a standard pf astat read file SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for pf astat read file FM, simply by entering the name PF_ASTAT_READ_FILE into the relevant SAP transaction such as SE37 or SE38.

Function Group: PFFB
Program Name: SAPLPFFB
Main Program: SAPLPFFB
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function PF_ASTAT_READ_FILE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'PF_ASTAT_READ_FILE'"
EXPORTING
* READ_FILE = "
* READ_MODE = PF_READ_NEXT_REC "Read mode
* TARGET_REC_NO = 0 "
* USER = ' ' "
* END_TIME = "
* END_DATE = SY-DATUM "
* KEYFILTERMODE = ' ' "Single-Character Flag
* IKEY_FILTER = "Key for the application statistics record
* OKEY_FILTER = "Key for the application statistics record

IMPORTING
ASTATREC = "
PRIVSUM_KB = "
USEDBYTES_KB = "
MAXBYTES_KB = "
MAXBYTESDIA_KB = "
ASCOLREC = "
RECTYPE = "
RECNO = "
NEW_FILE = "Single-Character Flag
ACT_FILENAME = "Character 100
FILEREC = "Natural Number
RECS_IN_FILE = "Natural Number
MEMSUM_KB = "

EXCEPTIONS
PF_END_OF_FILE = 1 PF_INTERNAL_ERROR = 2 PF_PARAMETER_ERROR = 3
.



IMPORTING Parameters details for PF_ASTAT_READ_FILE

READ_FILE -

Data type: PFFILE
Optional: Yes
Call by Reference: Yes

READ_MODE - Read mode

Data type: SY-INDEX
Default: PF_READ_NEXT_REC
Optional: Yes
Call by Reference: No ( called with pass by value option)

TARGET_REC_NO -

Data type: SY-INDEX
Optional: Yes
Call by Reference: No ( called with pass by value option)

USER -

Data type: SY-UNAME
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

END_TIME -

Data type: SY-UZEIT
Optional: Yes
Call by Reference: No ( called with pass by value option)

END_DATE -

Data type: SY-DATUM
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

KEYFILTERMODE - Single-Character Flag

Data type: CHAR1
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

IKEY_FILTER - Key for the application statistics record

Data type: PFASKEY
Optional: Yes
Call by Reference: No ( called with pass by value option)

OKEY_FILTER - Key for the application statistics record

Data type: PFASKEY
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for PF_ASTAT_READ_FILE

ASTATREC -

Data type: PFASREC
Optional: No
Call by Reference: No ( called with pass by value option)

PRIVSUM_KB -

Data type: INT4
Optional: No
Call by Reference: No ( called with pass by value option)

USEDBYTES_KB -

Data type: INT4
Optional: No
Call by Reference: No ( called with pass by value option)

MAXBYTES_KB -

Data type: INT4
Optional: No
Call by Reference: No ( called with pass by value option)

MAXBYTESDIA_KB -

Data type: INT4
Optional: No
Call by Reference: No ( called with pass by value option)

ASCOLREC -

Data type: PFACLREC
Optional: No
Call by Reference: No ( called with pass by value option)

RECTYPE -

Data type: PFDIAREC-RECTYPE
Optional: No
Call by Reference: No ( called with pass by value option)

RECNO -

Data type: SY-INDEX
Optional: No
Call by Reference: No ( called with pass by value option)

NEW_FILE - Single-Character Flag

Data type: CHAR1
Optional: No
Call by Reference: No ( called with pass by value option)

ACT_FILENAME - Character 100

Data type: CHAR100
Optional: No
Call by Reference: No ( called with pass by value option)

FILEREC - Natural Number

Data type: INT4
Optional: No
Call by Reference: No ( called with pass by value option)

RECS_IN_FILE - Natural Number

Data type: INT4
Optional: No
Call by Reference: No ( called with pass by value option)

MEMSUM_KB -

Data type: INT4
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

PF_END_OF_FILE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PF_INTERNAL_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PF_PARAMETER_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for PF_ASTAT_READ_FILE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_astatrec  TYPE PFASREC, "   
lv_read_file  TYPE PFFILE, "   
lv_pf_end_of_file  TYPE PFFILE, "   
lv_privsum_kb  TYPE INT4, "   
lv_usedbytes_kb  TYPE INT4, "   
lv_maxbytes_kb  TYPE INT4, "   
lv_maxbytesdia_kb  TYPE INT4, "   
lv_ascolrec  TYPE PFACLREC, "   
lv_read_mode  TYPE SY-INDEX, "   PF_READ_NEXT_REC
lv_pf_internal_error  TYPE SY, "   
lv_rectype  TYPE PFDIAREC-RECTYPE, "   
lv_target_rec_no  TYPE SY-INDEX, "   0
lv_pf_parameter_error  TYPE SY, "   
lv_user  TYPE SY-UNAME, "   ' '
lv_recno  TYPE SY-INDEX, "   
lv_end_time  TYPE SY-UZEIT, "   
lv_new_file  TYPE CHAR1, "   
lv_end_date  TYPE SY-DATUM, "   SY-DATUM
lv_act_filename  TYPE CHAR100, "   
lv_filerec  TYPE INT4, "   
lv_keyfiltermode  TYPE CHAR1, "   ' '
lv_ikey_filter  TYPE PFASKEY, "   
lv_recs_in_file  TYPE INT4, "   
lv_memsum_kb  TYPE INT4, "   
lv_okey_filter  TYPE PFASKEY. "   

  CALL FUNCTION 'PF_ASTAT_READ_FILE'  "
    EXPORTING
         READ_FILE = lv_read_file
         READ_MODE = lv_read_mode
         TARGET_REC_NO = lv_target_rec_no
         USER = lv_user
         END_TIME = lv_end_time
         END_DATE = lv_end_date
         KEYFILTERMODE = lv_keyfiltermode
         IKEY_FILTER = lv_ikey_filter
         OKEY_FILTER = lv_okey_filter
    IMPORTING
         ASTATREC = lv_astatrec
         PRIVSUM_KB = lv_privsum_kb
         USEDBYTES_KB = lv_usedbytes_kb
         MAXBYTES_KB = lv_maxbytes_kb
         MAXBYTESDIA_KB = lv_maxbytesdia_kb
         ASCOLREC = lv_ascolrec
         RECTYPE = lv_rectype
         RECNO = lv_recno
         NEW_FILE = lv_new_file
         ACT_FILENAME = lv_act_filename
         FILEREC = lv_filerec
         RECS_IN_FILE = lv_recs_in_file
         MEMSUM_KB = lv_memsum_kb
    EXCEPTIONS
        PF_END_OF_FILE = 1
        PF_INTERNAL_ERROR = 2
        PF_PARAMETER_ERROR = 3
. " PF_ASTAT_READ_FILE




ABAP code using 7.40 inline data declarations to call FM PF_ASTAT_READ_FILE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
 
 
 
 
 
 
"SELECT single INDEX FROM SY INTO @DATA(ld_read_mode).
DATA(ld_read_mode) = PF_READ_NEXT_REC.
 
 
"SELECT single RECTYPE FROM PFDIAREC INTO @DATA(ld_rectype).
 
"SELECT single INDEX FROM SY INTO @DATA(ld_target_rec_no).
 
 
"SELECT single UNAME FROM SY INTO @DATA(ld_user).
DATA(ld_user) = ' '.
 
"SELECT single INDEX FROM SY INTO @DATA(ld_recno).
 
"SELECT single UZEIT FROM SY INTO @DATA(ld_end_time).
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_end_date).
DATA(ld_end_date) = SY-DATUM.
 
 
 
DATA(ld_keyfiltermode) = ' '.
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!