SAP QTLS_SAMPLE_RESULTS_STATISTICS Function Module for Statistical values for inspection lot sample results
QTLS_SAMPLE_RESULTS_STATISTICS is a standard qtls sample results statistics SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Statistical values for inspection lot sample results processing and below is the pattern details for this FM, 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 qtls sample results statistics FM, simply by entering the name QTLS_SAMPLE_RESULTS_STATISTICS into the relevant SAP transaction such as SE37 or SE38.
Function Group: QTLS
Program Name: SAPLQTLS
Main Program: SAPLQTLS
Appliation area: Q
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function QTLS_SAMPLE_RESULTS_STATISTICS 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 'QTLS_SAMPLE_RESULTS_STATISTICS'"Statistical values for inspection lot sample results.
EXPORTING
I_PRUEFLOS = "
I_TEILLOS = "
IMPORTING
E_NO_OF_ACTIVES = "
E_NO_OF_REJECTS = "
E_NO_OF_ACCEPTS = "
E_NO_OF_SAMPLES = "
EXCEPTIONS
X_NO_DATA_FOUND = 1
IMPORTING Parameters details for QTLS_SAMPLE_RESULTS_STATISTICS
I_PRUEFLOS -
Data type: QALT-PRUEFLOSOptional: No
Call by Reference: No ( called with pass by value option)
I_TEILLOS -
Data type: QALT-TEILLOSOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for QTLS_SAMPLE_RESULTS_STATISTICS
E_NO_OF_ACTIVES -
Data type: QALT_UD-ANZPRBIBOptional: No
Call by Reference: No ( called with pass by value option)
E_NO_OF_REJECTS -
Data type: QALT_UD-ANZPRBREJOptional: No
Call by Reference: No ( called with pass by value option)
E_NO_OF_ACCEPTS -
Data type: QALT_UD-ANZPRBACCOptional: No
Call by Reference: No ( called with pass by value option)
E_NO_OF_SAMPLES -
Data type: QALT_UD-ANZPROBENOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
X_NO_DATA_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for QTLS_SAMPLE_RESULTS_STATISTICS 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_i_prueflos | TYPE QALT-PRUEFLOS, " | |||
| lv_e_no_of_actives | TYPE QALT_UD-ANZPRBIB, " | |||
| lv_x_no_data_found | TYPE QALT_UD, " | |||
| lv_i_teillos | TYPE QALT-TEILLOS, " | |||
| lv_e_no_of_rejects | TYPE QALT_UD-ANZPRBREJ, " | |||
| lv_e_no_of_accepts | TYPE QALT_UD-ANZPRBACC, " | |||
| lv_e_no_of_samples | TYPE QALT_UD-ANZPROBEN. " |
|   CALL FUNCTION 'QTLS_SAMPLE_RESULTS_STATISTICS' "Statistical values for inspection lot sample results |
| EXPORTING | ||
| I_PRUEFLOS | = lv_i_prueflos | |
| I_TEILLOS | = lv_i_teillos | |
| IMPORTING | ||
| E_NO_OF_ACTIVES | = lv_e_no_of_actives | |
| E_NO_OF_REJECTS | = lv_e_no_of_rejects | |
| E_NO_OF_ACCEPTS | = lv_e_no_of_accepts | |
| E_NO_OF_SAMPLES | = lv_e_no_of_samples | |
| EXCEPTIONS | ||
| X_NO_DATA_FOUND = 1 | ||
| . " QTLS_SAMPLE_RESULTS_STATISTICS | ||
ABAP code using 7.40 inline data declarations to call FM QTLS_SAMPLE_RESULTS_STATISTICS
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 PRUEFLOS FROM QALT INTO @DATA(ld_i_prueflos). | ||||
| "SELECT single ANZPRBIB FROM QALT_UD INTO @DATA(ld_e_no_of_actives). | ||||
| "SELECT single TEILLOS FROM QALT INTO @DATA(ld_i_teillos). | ||||
| "SELECT single ANZPRBREJ FROM QALT_UD INTO @DATA(ld_e_no_of_rejects). | ||||
| "SELECT single ANZPRBACC FROM QALT_UD INTO @DATA(ld_e_no_of_accepts). | ||||
| "SELECT single ANZPROBEN FROM QALT_UD INTO @DATA(ld_e_no_of_samples). | ||||
Search for further information about these or an SAP related objects