SAP SAPWL_STATREC_READ_FILE Function Module for
SAPWL_STATREC_READ_FILE is a standard sapwl statrec 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 sapwl statrec read file FM, simply by entering the name SAPWL_STATREC_READ_FILE into the relevant SAP transaction such as SE37 or SE38.
Function Group: STUW
Program Name: SAPLSTUW
Main Program: SAPLSTUW
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function SAPWL_STATREC_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 'SAPWL_STATREC_READ_FILE'".
EXPORTING
* NO_OF_RECORDS = -1 "No. of records to be read (<=0 -> all)
* READ_WORKPROCESS = 'FFFF' "Restriction to work process (default: all)
* READ_FORWARD = 'X' "
* STATISTIC_FILE = "Statistics file name (default: local)
* NO_BUFFER_FLUSH = ' ' "Statistics record buffer not empty (' ' or 'X')
* READ_CLIENT = "Restriction to client (default: all)
* READ_END_DATE = ' ' "Read end date (if no READ_START_OFFSET)
* READ_END_TIME = ' ' "Read end time (if no READ_START_OFFSET)
* READ_EXCLUDE_USERNAME = "Exclude users (default: none)
* READ_CONTINUE_RECORDNO = -1 "
* READ_START_DATE = ' ' "Read start date (if no READ_START_OFFSET)
* READ_START_TIME = ' ' "Read start time (if no READ_START_OFFSET)
* READ_USERNAME = "Restriction to user (default: all)
IMPORTING
FILE_ERROR = "Operating system file operation error text
RECORDS_READ = "Number of records read
EOF_REACHED = "
CONTINUE_RECORDNO_FORWARD = "
CONTINUE_RECORDNO_BACKWARD = "
PROBLEMS = "
TABLES
* V2_NORMAL_RECORDS = "Version 2: Normal records
* V2_RFC_TIME_INT_RECORDS = "
* NORM_SUBRECORD_INDEX = "Normal record subrecord index
* DB_PROCEDURE_RECORDS = "
* ADM_MESSAGE_RECORDS = "
* V2_BTC_STEP_RECORDS = "Version 2: Background records
* V2_TABLE_RECORDS = "Version 2: Table records
* V2_RFC_CLIENT_RECORDS = "Version 2: RFC client records
* V2_RFC_SERVER_RECORDS = "Version 2: RFC server records
* V2_RFC_CLIENT_DEST_RECORDS = "Version 2: RFC client destination records
* V2_RFC_SERVER_DEST_RECORDS = "Version 2: RFC server destination records
* V2_SPOOL_PRINT_RECORDS = "
* V2_SPOOL_ACTIVITY_RECORDS = "
EXCEPTIONS
WRONG_PARAMETER_COMBINATION = 1
IMPORTING Parameters details for SAPWL_STATREC_READ_FILE
NO_OF_RECORDS - No. of records to be read (<=0 -> all)
Data type: SAPWLSRIRNDefault: -1
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_WORKPROCESS - Restriction to work process (default: all)
Data type: SAPWLPSTRC-WP_NUMBERDefault: 'FFFF'
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_FORWARD -
Data type: SAPWLPSTRC-FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
STATISTIC_FILE - Statistics file name (default: local)
Data type: SAPWLPSTRC-FILENAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
NO_BUFFER_FLUSH - Statistics record buffer not empty (' ' or 'X')
Data type: SAPWLPSTRC-FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_CLIENT - Restriction to client (default: all)
Data type: SAPWLPSTRC-CLIENTOptional: Yes
Call by Reference: No ( called with pass by value option)
READ_END_DATE - Read end date (if no READ_START_OFFSET)
Data type: SY-DATUMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_END_TIME - Read end time (if no READ_START_OFFSET)
Data type: SY-UZEITDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_EXCLUDE_USERNAME - Exclude users (default: none)
Data type: SAPWLPSTRC-USERNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
READ_CONTINUE_RECORDNO -
Data type: SAPWLSRIRNDefault: -1
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_START_DATE - Read start date (if no READ_START_OFFSET)
Data type: SY-DATUMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_START_TIME - Read start time (if no READ_START_OFFSET)
Data type: SY-UZEITDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_USERNAME - Restriction to user (default: all)
Data type: SAPWLPSTRC-USERNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SAPWL_STATREC_READ_FILE
FILE_ERROR - Operating system file operation error text
Data type: SAPWLPSTRC-FILE_ERROROptional: No
Call by Reference: No ( called with pass by value option)
RECORDS_READ - Number of records read
Data type: SAPWLSRIRNOptional: No
Call by Reference: No ( called with pass by value option)
EOF_REACHED -
Data type: SAPWLPSTRC-FLAGOptional: No
Call by Reference: No ( called with pass by value option)
CONTINUE_RECORDNO_FORWARD -
Data type: SAPWLSFIHD-RECORDNOOptional: No
Call by Reference: No ( called with pass by value option)
CONTINUE_RECORDNO_BACKWARD -
Data type: SAPWLSFIHD-RECORDNOOptional: No
Call by Reference: No ( called with pass by value option)
PROBLEMS -
Data type: SAPWLPSTRC-COUNTEROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SAPWL_STATREC_READ_FILE
V2_NORMAL_RECORDS - Version 2: Normal records
Data type: SAPWLPFNRMOptional: Yes
Call by Reference: No ( called with pass by value option)
V2_RFC_TIME_INT_RECORDS -
Data type: SAPWLPFTIIOptional: Yes
Call by Reference: No ( called with pass by value option)
NORM_SUBRECORD_INDEX - Normal record subrecord index
Data type: SAPWLSRCIXOptional: Yes
Call by Reference: No ( called with pass by value option)
DB_PROCEDURE_RECORDS -
Data type: SAPWLPFDBPOptional: Yes
Call by Reference: Yes
ADM_MESSAGE_RECORDS -
Data type: SAPWLPFADMOptional: Yes
Call by Reference: Yes
V2_BTC_STEP_RECORDS - Version 2: Background records
Data type: SAPWLPFBTCOptional: Yes
Call by Reference: No ( called with pass by value option)
V2_TABLE_RECORDS - Version 2: Table records
Data type: SAPWLPFTABOptional: Yes
Call by Reference: No ( called with pass by value option)
V2_RFC_CLIENT_RECORDS - Version 2: RFC client records
Data type: SAPWLPFRCOptional: Yes
Call by Reference: No ( called with pass by value option)
V2_RFC_SERVER_RECORDS - Version 2: RFC server records
Data type: SAPWLPFRSOptional: Yes
Call by Reference: No ( called with pass by value option)
V2_RFC_CLIENT_DEST_RECORDS - Version 2: RFC client destination records
Data type: SAPWLPFRCDOptional: Yes
Call by Reference: No ( called with pass by value option)
V2_RFC_SERVER_DEST_RECORDS - Version 2: RFC server destination records
Data type: SAPWLPFRSDOptional: Yes
Call by Reference: No ( called with pass by value option)
V2_SPOOL_PRINT_RECORDS -
Data type: SAPWLPFSPPOptional: Yes
Call by Reference: No ( called with pass by value option)
V2_SPOOL_ACTIVITY_RECORDS -
Data type: SAPWLPFSPAOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
WRONG_PARAMETER_COMBINATION -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SAPWL_STATREC_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_file_error | TYPE SAPWLPSTRC-FILE_ERROR, " | |||
| lv_no_of_records | TYPE SAPWLSRIRN, " -1 | |||
| lt_v2_normal_records | TYPE STANDARD TABLE OF SAPWLPFNRM, " | |||
| lv_wrong_parameter_combination | TYPE SAPWLPFNRM, " | |||
| lv_read_workprocess | TYPE SAPWLPSTRC-WP_NUMBER, " 'FFFF' | |||
| lt_v2_rfc_time_int_records | TYPE STANDARD TABLE OF SAPWLPFTII, " | |||
| lv_read_forward | TYPE SAPWLPSTRC-FLAG, " 'X' | |||
| lt_norm_subrecord_index | TYPE STANDARD TABLE OF SAPWLSRCIX, " | |||
| lv_statistic_file | TYPE SAPWLPSTRC-FILENAME, " | |||
| lt_db_procedure_records | TYPE STANDARD TABLE OF SAPWLPFDBP, " | |||
| lv_no_buffer_flush | TYPE SAPWLPSTRC-FLAG, " SPACE | |||
| lt_adm_message_records | TYPE STANDARD TABLE OF SAPWLPFADM, " | |||
| lv_read_client | TYPE SAPWLPSTRC-CLIENT, " | |||
| lv_records_read | TYPE SAPWLSRIRN, " | |||
| lt_v2_btc_step_records | TYPE STANDARD TABLE OF SAPWLPFBTC, " | |||
| lv_eof_reached | TYPE SAPWLPSTRC-FLAG, " | |||
| lv_read_end_date | TYPE SY-DATUM, " SPACE | |||
| lt_v2_table_records | TYPE STANDARD TABLE OF SAPWLPFTAB, " | |||
| lv_read_end_time | TYPE SY-UZEIT, " SPACE | |||
| lt_v2_rfc_client_records | TYPE STANDARD TABLE OF SAPWLPFRC, " | |||
| lv_continue_recordno_forward | TYPE SAPWLSFIHD-RECORDNO, " | |||
| lv_read_exclude_username | TYPE SAPWLPSTRC-USERNAME, " | |||
| lt_v2_rfc_server_records | TYPE STANDARD TABLE OF SAPWLPFRS, " | |||
| lv_continue_recordno_backward | TYPE SAPWLSFIHD-RECORDNO, " | |||
| lv_problems | TYPE SAPWLPSTRC-COUNTER, " | |||
| lv_read_continue_recordno | TYPE SAPWLSRIRN, " -1 | |||
| lt_v2_rfc_client_dest_records | TYPE STANDARD TABLE OF SAPWLPFRCD, " | |||
| lv_read_start_date | TYPE SY-DATUM, " SPACE | |||
| lt_v2_rfc_server_dest_records | TYPE STANDARD TABLE OF SAPWLPFRSD, " | |||
| lv_read_start_time | TYPE SY-UZEIT, " SPACE | |||
| lt_v2_spool_print_records | TYPE STANDARD TABLE OF SAPWLPFSPP, " | |||
| lv_read_username | TYPE SAPWLPSTRC-USERNAME, " | |||
| lt_v2_spool_activity_records | TYPE STANDARD TABLE OF SAPWLPFSPA. " |
|   CALL FUNCTION 'SAPWL_STATREC_READ_FILE' " |
| EXPORTING | ||
| NO_OF_RECORDS | = lv_no_of_records | |
| READ_WORKPROCESS | = lv_read_workprocess | |
| READ_FORWARD | = lv_read_forward | |
| STATISTIC_FILE | = lv_statistic_file | |
| NO_BUFFER_FLUSH | = lv_no_buffer_flush | |
| READ_CLIENT | = lv_read_client | |
| READ_END_DATE | = lv_read_end_date | |
| READ_END_TIME | = lv_read_end_time | |
| READ_EXCLUDE_USERNAME | = lv_read_exclude_username | |
| READ_CONTINUE_RECORDNO | = lv_read_continue_recordno | |
| READ_START_DATE | = lv_read_start_date | |
| READ_START_TIME | = lv_read_start_time | |
| READ_USERNAME | = lv_read_username | |
| IMPORTING | ||
| FILE_ERROR | = lv_file_error | |
| RECORDS_READ | = lv_records_read | |
| EOF_REACHED | = lv_eof_reached | |
| CONTINUE_RECORDNO_FORWARD | = lv_continue_recordno_forward | |
| CONTINUE_RECORDNO_BACKWARD | = lv_continue_recordno_backward | |
| PROBLEMS | = lv_problems | |
| TABLES | ||
| V2_NORMAL_RECORDS | = lt_v2_normal_records | |
| V2_RFC_TIME_INT_RECORDS | = lt_v2_rfc_time_int_records | |
| NORM_SUBRECORD_INDEX | = lt_norm_subrecord_index | |
| DB_PROCEDURE_RECORDS | = lt_db_procedure_records | |
| ADM_MESSAGE_RECORDS | = lt_adm_message_records | |
| V2_BTC_STEP_RECORDS | = lt_v2_btc_step_records | |
| V2_TABLE_RECORDS | = lt_v2_table_records | |
| V2_RFC_CLIENT_RECORDS | = lt_v2_rfc_client_records | |
| V2_RFC_SERVER_RECORDS | = lt_v2_rfc_server_records | |
| V2_RFC_CLIENT_DEST_RECORDS | = lt_v2_rfc_client_dest_records | |
| V2_RFC_SERVER_DEST_RECORDS | = lt_v2_rfc_server_dest_records | |
| V2_SPOOL_PRINT_RECORDS | = lt_v2_spool_print_records | |
| V2_SPOOL_ACTIVITY_RECORDS | = lt_v2_spool_activity_records | |
| EXCEPTIONS | ||
| WRONG_PARAMETER_COMBINATION = 1 | ||
| . " SAPWL_STATREC_READ_FILE | ||
ABAP code using 7.40 inline data declarations to call FM SAPWL_STATREC_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 FILE_ERROR FROM SAPWLPSTRC INTO @DATA(ld_file_error). | ||||
| DATA(ld_no_of_records) | = -1. | |||
| "SELECT single WP_NUMBER FROM SAPWLPSTRC INTO @DATA(ld_read_workprocess). | ||||
| DATA(ld_read_workprocess) | = 'FFFF'. | |||
| "SELECT single FLAG FROM SAPWLPSTRC INTO @DATA(ld_read_forward). | ||||
| DATA(ld_read_forward) | = 'X'. | |||
| "SELECT single FILENAME FROM SAPWLPSTRC INTO @DATA(ld_statistic_file). | ||||
| "SELECT single FLAG FROM SAPWLPSTRC INTO @DATA(ld_no_buffer_flush). | ||||
| DATA(ld_no_buffer_flush) | = ' '. | |||
| "SELECT single CLIENT FROM SAPWLPSTRC INTO @DATA(ld_read_client). | ||||
| "SELECT single FLAG FROM SAPWLPSTRC INTO @DATA(ld_eof_reached). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_read_end_date). | ||||
| DATA(ld_read_end_date) | = ' '. | |||
| "SELECT single UZEIT FROM SY INTO @DATA(ld_read_end_time). | ||||
| DATA(ld_read_end_time) | = ' '. | |||
| "SELECT single RECORDNO FROM SAPWLSFIHD INTO @DATA(ld_continue_recordno_forward). | ||||
| "SELECT single USERNAME FROM SAPWLPSTRC INTO @DATA(ld_read_exclude_username). | ||||
| "SELECT single RECORDNO FROM SAPWLSFIHD INTO @DATA(ld_continue_recordno_backward). | ||||
| "SELECT single COUNTER FROM SAPWLPSTRC INTO @DATA(ld_problems). | ||||
| DATA(ld_read_continue_recordno) | = -1. | |||
| "SELECT single DATUM FROM SY INTO @DATA(ld_read_start_date). | ||||
| DATA(ld_read_start_date) | = ' '. | |||
| "SELECT single UZEIT FROM SY INTO @DATA(ld_read_start_time). | ||||
| DATA(ld_read_start_time) | = ' '. | |||
| "SELECT single USERNAME FROM SAPWLPSTRC INTO @DATA(ld_read_username). | ||||
Search for further information about these or an SAP related objects