SAP QDSE_DYNAMIC_SAMPLING Function Module for Sample Determination
QDSE_DYNAMIC_SAMPLING is a standard qdse dynamic sampling SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Sample Determination 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 qdse dynamic sampling FM, simply by entering the name QDSE_DYNAMIC_SAMPLING into the relevant SAP transaction such as SE37 or SE38.
Function Group: QDSE
Program Name: SAPLQDSE
Main Program: SAPLQDSE
Appliation area: Q
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function QDSE_DYNAMIC_SAMPLING 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 'QDSE_DYNAMIC_SAMPLING'"Sample Determination.
EXPORTING
DYNHEAD_IMP = "Dynamic modification level (from the task list)
DYNREGEL_IMP = "Dynamic modification rule
DYNSTRING_IMP = "
QALS_WA_IMP = "Inspection lot work area
IMPORTING
DYNKRIT_EXP = "Dynamic modification criteria
QALS_PRSCHAERFE_EXP = "
QALS_STAT44_EXP = "Indicator: dynamic modification rule is available
GESSTICHPR_EXP = "Total sample size for the inspection lot
LMENGELZ_EXP = "Inspection quantity for long-term characteristics
LMENGEPR_EXP = "Actual inspected quantity
OFFENNLZMK_EXP = "Counter for open short-term characteristics
OFFEN_LZMK_EXP = "Counter for open long-term characteristics
QALS_DYNHEAD_EXP = "Dynamic mod. level
QALS_DYNREGEL_EXP = "
QALS_PRSTUFE_EXP = "
TABLES
QAMVTAB = "Table for characteristic requirements
QAPOTAB = "Table of Operations
QASVTAB = "Table of sample requirements
IMPORTING Parameters details for QDSE_DYNAMIC_SAMPLING
DYNHEAD_IMP - Dynamic modification level (from the task list)
Data type: PLKO-QDYNHEADOptional: No
Call by Reference: No ( called with pass by value option)
DYNREGEL_IMP - Dynamic modification rule
Data type: PLKO-QDYNREGELOptional: No
Call by Reference: No ( called with pass by value option)
DYNSTRING_IMP -
Data type: PLKO-QDYNSTRINGOptional: No
Call by Reference: No ( called with pass by value option)
QALS_WA_IMP - Inspection lot work area
Data type: QALSOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for QDSE_DYNAMIC_SAMPLING
DYNKRIT_EXP - Dynamic modification criteria
Data type: QDDYNOptional: No
Call by Reference: No ( called with pass by value option)
QALS_PRSCHAERFE_EXP -
Data type: QALS-PRSCHAERFEOptional: No
Call by Reference: No ( called with pass by value option)
QALS_STAT44_EXP - Indicator: dynamic modification rule is available
Data type: QALS-STAT44Optional: No
Call by Reference: No ( called with pass by value option)
GESSTICHPR_EXP - Total sample size for the inspection lot
Data type: QALS-GESSTICHPROptional: No
Call by Reference: No ( called with pass by value option)
LMENGELZ_EXP - Inspection quantity for long-term characteristics
Data type: QALS-LMENGELZOptional: No
Call by Reference: No ( called with pass by value option)
LMENGEPR_EXP - Actual inspected quantity
Data type: QALS-LMENGEPROptional: No
Call by Reference: No ( called with pass by value option)
OFFENNLZMK_EXP - Counter for open short-term characteristics
Data type: QALS-OFFENNLZMKOptional: No
Call by Reference: No ( called with pass by value option)
OFFEN_LZMK_EXP - Counter for open long-term characteristics
Data type: QALS-OFFEN_LZMKOptional: No
Call by Reference: No ( called with pass by value option)
QALS_DYNHEAD_EXP - Dynamic mod. level
Data type: QALS-DYNHEADOptional: No
Call by Reference: No ( called with pass by value option)
QALS_DYNREGEL_EXP -
Data type: QALS-DYNREGELOptional: No
Call by Reference: No ( called with pass by value option)
QALS_PRSTUFE_EXP -
Data type: QALS-PRSTUFEOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for QDSE_DYNAMIC_SAMPLING
QAMVTAB - Table for characteristic requirements
Data type: QAMVOptional: No
Call by Reference: No ( called with pass by value option)
QAPOTAB - Table of Operations
Data type: QAPOOptional: No
Call by Reference: No ( called with pass by value option)
QASVTAB - Table of sample requirements
Data type: QASVOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for QDSE_DYNAMIC_SAMPLING 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: | ||||
| lt_qamvtab | TYPE STANDARD TABLE OF QAMV, " | |||
| lv_dynhead_imp | TYPE PLKO-QDYNHEAD, " | |||
| lv_dynkrit_exp | TYPE QDDYN, " | |||
| lv_qals_prschaerfe_exp | TYPE QALS-PRSCHAERFE, " | |||
| lv_qals_stat44_exp | TYPE QALS-STAT44, " | |||
| lt_qapotab | TYPE STANDARD TABLE OF QAPO, " | |||
| lv_dynregel_imp | TYPE PLKO-QDYNREGEL, " | |||
| lv_gesstichpr_exp | TYPE QALS-GESSTICHPR, " | |||
| lt_qasvtab | TYPE STANDARD TABLE OF QASV, " | |||
| lv_lmengelz_exp | TYPE QALS-LMENGELZ, " | |||
| lv_dynstring_imp | TYPE PLKO-QDYNSTRING, " | |||
| lv_qals_wa_imp | TYPE QALS, " | |||
| lv_lmengepr_exp | TYPE QALS-LMENGEPR, " | |||
| lv_offennlzmk_exp | TYPE QALS-OFFENNLZMK, " | |||
| lv_offen_lzmk_exp | TYPE QALS-OFFEN_LZMK, " | |||
| lv_qals_dynhead_exp | TYPE QALS-DYNHEAD, " | |||
| lv_qals_dynregel_exp | TYPE QALS-DYNREGEL, " | |||
| lv_qals_prstufe_exp | TYPE QALS-PRSTUFE. " |
|   CALL FUNCTION 'QDSE_DYNAMIC_SAMPLING' "Sample Determination |
| EXPORTING | ||
| DYNHEAD_IMP | = lv_dynhead_imp | |
| DYNREGEL_IMP | = lv_dynregel_imp | |
| DYNSTRING_IMP | = lv_dynstring_imp | |
| QALS_WA_IMP | = lv_qals_wa_imp | |
| IMPORTING | ||
| DYNKRIT_EXP | = lv_dynkrit_exp | |
| QALS_PRSCHAERFE_EXP | = lv_qals_prschaerfe_exp | |
| QALS_STAT44_EXP | = lv_qals_stat44_exp | |
| GESSTICHPR_EXP | = lv_gesstichpr_exp | |
| LMENGELZ_EXP | = lv_lmengelz_exp | |
| LMENGEPR_EXP | = lv_lmengepr_exp | |
| OFFENNLZMK_EXP | = lv_offennlzmk_exp | |
| OFFEN_LZMK_EXP | = lv_offen_lzmk_exp | |
| QALS_DYNHEAD_EXP | = lv_qals_dynhead_exp | |
| QALS_DYNREGEL_EXP | = lv_qals_dynregel_exp | |
| QALS_PRSTUFE_EXP | = lv_qals_prstufe_exp | |
| TABLES | ||
| QAMVTAB | = lt_qamvtab | |
| QAPOTAB | = lt_qapotab | |
| QASVTAB | = lt_qasvtab | |
| . " QDSE_DYNAMIC_SAMPLING | ||
ABAP code using 7.40 inline data declarations to call FM QDSE_DYNAMIC_SAMPLING
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 QDYNHEAD FROM PLKO INTO @DATA(ld_dynhead_imp). | ||||
| "SELECT single PRSCHAERFE FROM QALS INTO @DATA(ld_qals_prschaerfe_exp). | ||||
| "SELECT single STAT44 FROM QALS INTO @DATA(ld_qals_stat44_exp). | ||||
| "SELECT single QDYNREGEL FROM PLKO INTO @DATA(ld_dynregel_imp). | ||||
| "SELECT single GESSTICHPR FROM QALS INTO @DATA(ld_gesstichpr_exp). | ||||
| "SELECT single LMENGELZ FROM QALS INTO @DATA(ld_lmengelz_exp). | ||||
| "SELECT single QDYNSTRING FROM PLKO INTO @DATA(ld_dynstring_imp). | ||||
| "SELECT single LMENGEPR FROM QALS INTO @DATA(ld_lmengepr_exp). | ||||
| "SELECT single OFFENNLZMK FROM QALS INTO @DATA(ld_offennlzmk_exp). | ||||
| "SELECT single OFFEN_LZMK FROM QALS INTO @DATA(ld_offen_lzmk_exp). | ||||
| "SELECT single DYNHEAD FROM QALS INTO @DATA(ld_qals_dynhead_exp). | ||||
| "SELECT single DYNREGEL FROM QALS INTO @DATA(ld_qals_dynregel_exp). | ||||
| "SELECT single PRSTUFE FROM QALS INTO @DATA(ld_qals_prstufe_exp). | ||||
Search for further information about these or an SAP related objects