SAP SWNCGL_STATREC_READ_INSTANCE Function Module for
SWNCGL_STATREC_READ_INSTANCE is a standard swncgl 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 swncgl statrec read instance FM, simply by entering the name SWNCGL_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 SWNCGL_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 'SWNCGL_STATREC_READ_INSTANCE'".
EXPORTING
* READ_TIMEZONE = 'UTC' "
* READ_WORKPROCESS = 'FFFF' "
* READ_TRANSIDS = "
* READ_TCODE = "
* READ_DIALOGSTEPID = "
* FLAG_READ_STAT = 'X' "
* FLAG_READ_ASTAT = ' ' "
* GET_COMP_HIERARCHY = ' ' "
* GET_ORG_UNITS = ' ' "
* 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 = "
EXTPASSPORTRECS = "
WEBSERVICERECS = "
TREXRECS = "
EXCEPTIONS
READ_ERROR = 1
IMPORTING Parameters details for SWNCGL_STATREC_READ_INSTANCE
READ_TIMEZONE -
Data type: SWNCTIMEZONEDefault: 'UTC'
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_WORKPROCESS -
Data type: SWNCRSHRTDefault: 'FFFF'
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_TRANSIDS -
Data type: SWNC_T_TRANSIDSOptional: Yes
Call by Reference: No ( called with pass by value option)
READ_TCODE -
Data type: SWNCTCODEOptional: Yes
Call by Reference: No ( called with pass by value option)
READ_DIALOGSTEPID -
Data type: SWNCSTEPGUIDOptional: Yes
Call by Reference: No ( called with pass by value option)
FLAG_READ_STAT -
Data type: SWNC_CFLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLAG_READ_ASTAT -
Data type: SWNC_CFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
GET_COMP_HIERARCHY -
Data type: SWNC_CFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
GET_ORG_UNITS -
Data type: SWNC_CFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_OF_RECORDS -
Data type: SWNCRECSDefault: -1
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_START_DATE -
Data type: SWNCDATUMOptional: No
Call by Reference: No ( called with pass by value option)
READ_START_TIME -
Data type: SWNCUZEITOptional: No
Call by Reference: No ( called with pass by value option)
READ_END_DATE -
Data type: SWNCDATUMOptional: No
Call by Reference: No ( called with pass by value option)
READ_END_TIME -
Data type: SWNCUZEITOptional: No
Call by Reference: No ( called with pass by value option)
READ_CLIENT -
Data type: SWNCMANDTOptional: Yes
Call by Reference: No ( called with pass by value option)
READ_USERNAME -
Data type: SWNCUNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
FLAG_EXCLUDE_USERNAME -
Data type: SWNC_CFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SWNCGL_STATREC_READ_INSTANCE
STATRECS -
Data type: SWNCGL_T_STATRECSOptional: No
Call by Reference: No ( called with pass by value option)
RECORDS_READ -
Data type: SWNCSHCNTOptional: No
Call by Reference: No ( called with pass by value option)
SINGLE_RECORDS_READ -
Data type: SWNCSHCNTOptional: No
Call by Reference: No ( called with pass by value option)
EOI_REACHED -
Data type: SWNC_CFLAGOptional: No
Call by Reference: No ( called with pass by value option)
EOF_REACHED -
Data type: SWNC_CFLAGOptional: No
Call by Reference: No ( called with pass by value option)
ANONYMOUS -
Data type: SWNC_CFLAGOptional: No
Call by Reference: No ( called with pass by value option)
EXTPASSPORTRECS -
Data type: SWNCGL_T_EXTPASSPORTRECOptional: No
Call by Reference: No ( called with pass by value option)
WEBSERVICERECS -
Data type: SWNCGL_T_WEBSERVICERECOptional: No
Call by Reference: No ( called with pass by value option)
TREXRECS -
Data type: SWNCGL_T_TREXRECOptional: 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 SWNCGL_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 SWNCGL_T_STATRECS, " | |||
| lv_read_error | TYPE SWNCGL_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_flag_read_stat | TYPE SWNC_CFLAG, " 'X' | |||
| lv_flag_read_astat | TYPE SWNC_CFLAG, " SPACE | |||
| lv_get_comp_hierarchy | TYPE SWNC_CFLAG, " SPACE | |||
| lv_get_org_units | 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_extpassportrecs | TYPE SWNCGL_T_EXTPASSPORTREC, " | |||
| lv_read_username | TYPE SWNCUNAME, " | |||
| lv_webservicerecs | TYPE SWNCGL_T_WEBSERVICEREC, " | |||
| lv_trexrecs | TYPE SWNCGL_T_TREXREC, " | |||
| lv_flag_exclude_username | TYPE SWNC_CFLAG. " |
|   CALL FUNCTION 'SWNCGL_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 | |
| FLAG_READ_STAT | = lv_flag_read_stat | |
| FLAG_READ_ASTAT | = lv_flag_read_astat | |
| GET_COMP_HIERARCHY | = lv_get_comp_hierarchy | |
| GET_ORG_UNITS | = lv_get_org_units | |
| 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 | |
| EXTPASSPORTRECS | = lv_extpassportrecs | |
| WEBSERVICERECS | = lv_webservicerecs | |
| TREXRECS | = lv_trexrecs | |
| EXCEPTIONS | ||
| READ_ERROR = 1 | ||
| . " SWNCGL_STATREC_READ_INSTANCE | ||
ABAP code using 7.40 inline data declarations to call FM SWNCGL_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_get_comp_hierarchy) | = ' '. | |||
| DATA(ld_get_org_units) | = ' '. | |||
| DATA(ld_no_of_records) | = -1. | |||
Search for further information about these or an SAP related objects