SAP SWNC_STATREC_READ_INSTANCE Function Module for









SWNC_STATREC_READ_INSTANCE is a standard swnc statrec read instance 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 swnc statrec read instance FM, simply by entering the name SWNC_STATREC_READ_INSTANCE into the relevant SAP transaction such as SE37 or SE38.

Function Group: SCSM_READ_STATISTICS
Program Name: SAPLSCSM_READ_STATISTICS
Main Program: SAPLSCSM_READ_STATISTICS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function SWNC_STATREC_READ_INSTANCE 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 'SWNC_STATREC_READ_INSTANCE'"
EXPORTING
* READ_TIMEZONE = 'UTC' "
* READ_WORKPROCESS = 'FFFF' "
* READ_TRANSIDS = "
* READ_TCODE = "
* READ_DIALOGSTEPID = "
* STATISTIC_FILE = "
* ASTAT_FILE = "
* NO_BUFFER_FLUSH = "
* FLAG_READ_STAT = 'X' "
* FLAG_READ_ASTAT = ' ' "
* NO_OF_RECORDS = -1 "
READ_START_DATE = "
READ_START_TIME = "
READ_END_DATE = "
READ_END_TIME = "
* READ_CLIENT = "
* READ_USERNAME = "
* FLAG_EXCLUDE_USERNAME = ' ' "

IMPORTING
STATRECS = "
RECORDS_READ = "
SINGLE_RECORDS_READ = "
EOI_REACHED = "
EOF_REACHED = "
ANONYMOUS = "

EXCEPTIONS
READ_ERROR = 1
.



IMPORTING Parameters details for SWNC_STATREC_READ_INSTANCE

READ_TIMEZONE -

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

READ_WORKPROCESS -

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

READ_TRANSIDS -

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

READ_TCODE -

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

READ_DIALOGSTEPID -

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

STATISTIC_FILE -

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

ASTAT_FILE -

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

NO_BUFFER_FLUSH -

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

FLAG_READ_STAT -

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

FLAG_READ_ASTAT -

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

NO_OF_RECORDS -

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

READ_START_DATE -

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

READ_START_TIME -

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

READ_END_DATE -

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

READ_END_TIME -

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

READ_CLIENT -

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

READ_USERNAME -

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

FLAG_EXCLUDE_USERNAME -

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

EXPORTING Parameters details for SWNC_STATREC_READ_INSTANCE

STATRECS -

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

RECORDS_READ -

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

SINGLE_RECORDS_READ -

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

EOI_REACHED -

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

EOF_REACHED -

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

ANONYMOUS -

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

EXCEPTIONS details

READ_ERROR -

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

Copy and paste ABAP code example for SWNC_STATREC_READ_INSTANCE 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_statrecs  TYPE SWNC_T_STATRECS, "   
lv_read_error  TYPE SWNC_T_STATRECS, "   
lv_read_timezone  TYPE SWNCTIMEZONE, "   'UTC'
lv_read_workprocess  TYPE SWNCRSHRT, "   'FFFF'
lv_read_transids  TYPE SWNC_T_TRANSIDS, "   
lv_read_tcode  TYPE SWNCTCODE, "   
lv_read_dialogstepid  TYPE SWNCSTEPGUID, "   
lv_statistic_file  TYPE SWNCSTATFILENAME, "   
lv_astat_file  TYPE SWNCSTATFILENAME, "   
lv_no_buffer_flush  TYPE SWNC_CFLAG, "   
lv_flag_read_stat  TYPE SWNC_CFLAG, "   'X'
lv_flag_read_astat  TYPE SWNC_CFLAG, "   SPACE
lv_records_read  TYPE SWNCSHCNT, "   
lv_no_of_records  TYPE SWNCRECS, "   -1
lv_read_start_date  TYPE SWNCDATUM, "   
lv_single_records_read  TYPE SWNCSHCNT, "   
lv_eoi_reached  TYPE SWNC_CFLAG, "   
lv_read_start_time  TYPE SWNCUZEIT, "   
lv_eof_reached  TYPE SWNC_CFLAG, "   
lv_read_end_date  TYPE SWNCDATUM, "   
lv_anonymous  TYPE SWNC_CFLAG, "   
lv_read_end_time  TYPE SWNCUZEIT, "   
lv_read_client  TYPE SWNCMANDT, "   
lv_read_username  TYPE SWNCUNAME, "   
lv_flag_exclude_username  TYPE SWNC_CFLAG. "   SPACE

  CALL FUNCTION 'SWNC_STATREC_READ_INSTANCE'  "
    EXPORTING
         READ_TIMEZONE = lv_read_timezone
         READ_WORKPROCESS = lv_read_workprocess
         READ_TRANSIDS = lv_read_transids
         READ_TCODE = lv_read_tcode
         READ_DIALOGSTEPID = lv_read_dialogstepid
         STATISTIC_FILE = lv_statistic_file
         ASTAT_FILE = lv_astat_file
         NO_BUFFER_FLUSH = lv_no_buffer_flush
         FLAG_READ_STAT = lv_flag_read_stat
         FLAG_READ_ASTAT = lv_flag_read_astat
         NO_OF_RECORDS = lv_no_of_records
         READ_START_DATE = lv_read_start_date
         READ_START_TIME = lv_read_start_time
         READ_END_DATE = lv_read_end_date
         READ_END_TIME = lv_read_end_time
         READ_CLIENT = lv_read_client
         READ_USERNAME = lv_read_username
         FLAG_EXCLUDE_USERNAME = lv_flag_exclude_username
    IMPORTING
         STATRECS = lv_statrecs
         RECORDS_READ = lv_records_read
         SINGLE_RECORDS_READ = lv_single_records_read
         EOI_REACHED = lv_eoi_reached
         EOF_REACHED = lv_eof_reached
         ANONYMOUS = lv_anonymous
    EXCEPTIONS
        READ_ERROR = 1
. " SWNC_STATREC_READ_INSTANCE




ABAP code using 7.40 inline data declarations to call FM SWNC_STATREC_READ_INSTANCE

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.

 
 
DATA(ld_read_timezone) = 'UTC'.
 
DATA(ld_read_workprocess) = 'FFFF'.
 
 
 
 
 
 
 
DATA(ld_flag_read_stat) = 'X'.
 
DATA(ld_flag_read_astat) = ' '.
 
 
DATA(ld_no_of_records) = -1.
 
 
 
 
 
 
 
 
 
 
 
DATA(ld_flag_exclude_username) = ' '.
 


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!