SAP QPK1_SL_CODE_SELECTION_LEAN Function Module for Selection of several codes
QPK1_SL_CODE_SELECTION_LEAN is a standard qpk1 sl code selection lean SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Selection of several codes 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 qpk1 sl code selection lean FM, simply by entering the name QPK1_SL_CODE_SELECTION_LEAN into the relevant SAP transaction such as SE37 or SE38.
Function Group: QPK1
Program Name: SAPLQPK1
Main Program: SAPLQPK1
Appliation area: Q
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function QPK1_SL_CODE_SELECTION_LEAN 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 'QPK1_SL_CODE_SELECTION_LEAN'"Selection of several codes.
EXPORTING
I_KATALOGART = "Catalog type
* I_WINY2 = 25 "Right limit of the dialog box
* I_DISPLAY_MODE = "Indicator: Display mode (on='X')
* I_RETURN_IF_ONE = 'X' "Indicator: no list if one entry found (on='X')
* I_PICKUP_MODE = "Indicator: select only one entry (on='X')
* I_RETURN_IF_MANY = "Indicator: check existence only (on='X')
* I_NO_USAGEINDICATION = "Indicator: no usage indication set (on='X')
I_WERKS = "Filter for the plants (coding by *,+)
* I_AUSWAHLMGE = '*' "Selected sets filter (coding by *,+)
* I_CODEGRUPPE = '*' "Code groups filter (coding by *,+)
* I_CODE = '*' "Codes filter (coding by *,+)
* I_SPRACHE = SY-LANGU "Language for the text
* I_WINX1 = 10 "Upper limit of the dialog box
* I_WINX2 = 70 "Lower limit of the dialog box
* I_WINY1 = 5 "Left limit of the dialog box
TABLES
T_QPK1ACTAB = "Selection codes master record with texts
EXCEPTIONS
NO_MATCH_IN_RANGE = 1 NO_USER_SELECTION = 2 OBJECT_LOCKED = 3 LOCK_ERROR = 4 OBJECT_MISSING = 5
IMPORTING Parameters details for QPK1_SL_CODE_SELECTION_LEAN
I_KATALOGART - Catalog type
Data type: QPAC-KATALOGARTOptional: No
Call by Reference: No ( called with pass by value option)
I_WINY2 - Right limit of the dialog box
Data type: SY-WINY2Default: 25
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DISPLAY_MODE - Indicator: Display mode (on='X')
Data type: QM00-QKZOptional: Yes
Call by Reference: No ( called with pass by value option)
I_RETURN_IF_ONE - Indicator: no list if one entry found (on='X')
Data type: QM00-QKZDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_PICKUP_MODE - Indicator: select only one entry (on='X')
Data type: QM00-QKZOptional: Yes
Call by Reference: No ( called with pass by value option)
I_RETURN_IF_MANY - Indicator: check existence only (on='X')
Data type: QM00-QKZOptional: Yes
Call by Reference: No ( called with pass by value option)
I_NO_USAGEINDICATION - Indicator: no usage indication set (on='X')
Data type: QM00-QKZOptional: Yes
Call by Reference: No ( called with pass by value option)
I_WERKS - Filter for the plants (coding by *,+)
Data type: QPAM-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
I_AUSWAHLMGE - Selected sets filter (coding by *,+)
Data type: QPAC-AUSWAHLMGEDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CODEGRUPPE - Code groups filter (coding by *,+)
Data type: QPGR-CODEGRUPPEDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CODE - Codes filter (coding by *,+)
Data type: QPCD-CODEDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SPRACHE - Language for the text
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WINX1 - Upper limit of the dialog box
Data type: SY-WINX1Default: 10
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WINX2 - Lower limit of the dialog box
Data type: SY-WINX2Default: 70
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WINY1 - Left limit of the dialog box
Data type: SY-WINY1Default: 5
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for QPK1_SL_CODE_SELECTION_LEAN
T_QPK1ACTAB - Selection codes master record with texts
Data type: QPK1ACOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_MATCH_IN_RANGE - No entries found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_USER_SELECTION - No entries were selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_LOCKED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOCK_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_MISSING -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for QPK1_SL_CODE_SELECTION_LEAN 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_t_qpk1actab | TYPE STANDARD TABLE OF QPK1AC, " | |||
| lv_i_katalogart | TYPE QPAC-KATALOGART, " | |||
| lv_no_match_in_range | TYPE QPAC, " | |||
| lv_i_winy2 | TYPE SY-WINY2, " 25 | |||
| lv_i_display_mode | TYPE QM00-QKZ, " | |||
| lv_i_return_if_one | TYPE QM00-QKZ, " 'X' | |||
| lv_i_pickup_mode | TYPE QM00-QKZ, " | |||
| lv_i_return_if_many | TYPE QM00-QKZ, " | |||
| lv_i_no_usageindication | TYPE QM00-QKZ, " | |||
| lv_i_werks | TYPE QPAM-WERKS, " | |||
| lv_no_user_selection | TYPE QPAM, " | |||
| lv_i_auswahlmge | TYPE QPAC-AUSWAHLMGE, " '*' | |||
| lv_object_locked | TYPE QPAC, " | |||
| lv_lock_error | TYPE QPAC, " | |||
| lv_i_codegruppe | TYPE QPGR-CODEGRUPPE, " '*' | |||
| lv_i_code | TYPE QPCD-CODE, " '*' | |||
| lv_object_missing | TYPE QPCD, " | |||
| lv_i_sprache | TYPE SY-LANGU, " SY-LANGU | |||
| lv_i_winx1 | TYPE SY-WINX1, " 10 | |||
| lv_i_winx2 | TYPE SY-WINX2, " 70 | |||
| lv_i_winy1 | TYPE SY-WINY1. " 5 |
|   CALL FUNCTION 'QPK1_SL_CODE_SELECTION_LEAN' "Selection of several codes |
| EXPORTING | ||
| I_KATALOGART | = lv_i_katalogart | |
| I_WINY2 | = lv_i_winy2 | |
| I_DISPLAY_MODE | = lv_i_display_mode | |
| I_RETURN_IF_ONE | = lv_i_return_if_one | |
| I_PICKUP_MODE | = lv_i_pickup_mode | |
| I_RETURN_IF_MANY | = lv_i_return_if_many | |
| I_NO_USAGEINDICATION | = lv_i_no_usageindication | |
| I_WERKS | = lv_i_werks | |
| I_AUSWAHLMGE | = lv_i_auswahlmge | |
| I_CODEGRUPPE | = lv_i_codegruppe | |
| I_CODE | = lv_i_code | |
| I_SPRACHE | = lv_i_sprache | |
| I_WINX1 | = lv_i_winx1 | |
| I_WINX2 | = lv_i_winx2 | |
| I_WINY1 | = lv_i_winy1 | |
| TABLES | ||
| T_QPK1ACTAB | = lt_t_qpk1actab | |
| EXCEPTIONS | ||
| NO_MATCH_IN_RANGE = 1 | ||
| NO_USER_SELECTION = 2 | ||
| OBJECT_LOCKED = 3 | ||
| LOCK_ERROR = 4 | ||
| OBJECT_MISSING = 5 | ||
| . " QPK1_SL_CODE_SELECTION_LEAN | ||
ABAP code using 7.40 inline data declarations to call FM QPK1_SL_CODE_SELECTION_LEAN
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 KATALOGART FROM QPAC INTO @DATA(ld_i_katalogart). | ||||
| "SELECT single WINY2 FROM SY INTO @DATA(ld_i_winy2). | ||||
| DATA(ld_i_winy2) | = 25. | |||
| "SELECT single QKZ FROM QM00 INTO @DATA(ld_i_display_mode). | ||||
| "SELECT single QKZ FROM QM00 INTO @DATA(ld_i_return_if_one). | ||||
| DATA(ld_i_return_if_one) | = 'X'. | |||
| "SELECT single QKZ FROM QM00 INTO @DATA(ld_i_pickup_mode). | ||||
| "SELECT single QKZ FROM QM00 INTO @DATA(ld_i_return_if_many). | ||||
| "SELECT single QKZ FROM QM00 INTO @DATA(ld_i_no_usageindication). | ||||
| "SELECT single WERKS FROM QPAM INTO @DATA(ld_i_werks). | ||||
| "SELECT single AUSWAHLMGE FROM QPAC INTO @DATA(ld_i_auswahlmge). | ||||
| DATA(ld_i_auswahlmge) | = '*'. | |||
| "SELECT single CODEGRUPPE FROM QPGR INTO @DATA(ld_i_codegruppe). | ||||
| DATA(ld_i_codegruppe) | = '*'. | |||
| "SELECT single CODE FROM QPCD INTO @DATA(ld_i_code). | ||||
| DATA(ld_i_code) | = '*'. | |||
| "SELECT single LANGU FROM SY INTO @DATA(ld_i_sprache). | ||||
| DATA(ld_i_sprache) | = SY-LANGU. | |||
| "SELECT single WINX1 FROM SY INTO @DATA(ld_i_winx1). | ||||
| DATA(ld_i_winx1) | = 10. | |||
| "SELECT single WINX2 FROM SY INTO @DATA(ld_i_winx2). | ||||
| DATA(ld_i_winx2) | = 70. | |||
| "SELECT single WINY1 FROM SY INTO @DATA(ld_i_winy1). | ||||
| DATA(ld_i_winy1) | = 5. | |||
Search for further information about these or an SAP related objects