SAP QPK1_GP_CODE_SELECTION Function Module for Selection of several codes
QPK1_GP_CODE_SELECTION is a standard qpk1 gp code selection 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 gp code selection FM, simply by entering the name QPK1_GP_CODE_SELECTION 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:
![](https://www.se80.co.uk/training-education/wp-content/uploads/2019/07/normal-function-module.png)
Function QPK1_GP_CODE_SELECTION 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_GP_CODE_SELECTION'"Selection of several codes.
EXPORTING
I_KATALOGART = "Catalog type
* 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_NO_AUTHORITY_CHECK = "Indicator: no authorization check (on='X')
* I_CODEGRUPPE = "Code groups filter (coding by *,+)
* I_CODE = '*' "Codes filter (coding by *,+)
* I_SPRACHE = SY-LANGU "Language for text output
* I_WINX1 = 10 "Left limit of the dialog box
* I_WINX2 = 70 "Right limit of the dialog box
* I_WINY1 = 5 "Upper limit of the dialog box
* I_WINY2 = 25 "Lower limit of the dialog box
* I_DISPLAY_MODE = "Indicator: Display mode (on='X')
TABLES
T_QPK1CDTAB = "Table of master records for codes and texts
* T_CODEGRPTAB = "
EXCEPTIONS
NO_MATCH_IN_RANGE = 1 NO_USER_SELECTION = 2 NO_AUTHORIZATION = 3 NO_SELECTION_SPECIFIED = 4 OBJECT_LOCKED = 5 LOCK_ERROR = 6 OBJECT_MISSING = 7
IMPORTING Parameters details for QPK1_GP_CODE_SELECTION
I_KATALOGART - Catalog type
Data type: QPGR-KATALOGARTOptional: No
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_NO_AUTHORITY_CHECK - Indicator: no authorization check (on='X')
Data type: QM00-QKZOptional: Yes
Call by Reference: No ( called with pass by value option)
I_CODEGRUPPE - Code groups filter (coding by *,+)
Data type: QPGR-CODEGRUPPEOptional: 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 text output
Data type: QPGT-SPRACHEDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WINX1 - Left limit of the dialog box
Data type: SY-WINX1Default: 10
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WINX2 - Right limit of the dialog box
Data type: SY-WINX2Default: 70
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WINY1 - Upper limit of the dialog box
Data type: SY-WINY1Default: 5
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WINY2 - Lower 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)
TABLES Parameters details for QPK1_GP_CODE_SELECTION
T_QPK1CDTAB - Table of master records for codes and texts
Data type: QPK1CDOptional: No
Call by Reference: No ( called with pass by value option)
T_CODEGRPTAB -
Data type: QPK1CODEGRPOptional: Yes
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)
NO_AUTHORIZATION - No authorization for a single entry
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_SELECTION_SPECIFIED -
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_GP_CODE_SELECTION 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_qpk1cdtab | TYPE STANDARD TABLE OF QPK1CD, " | |||
lv_i_katalogart | TYPE QPGR-KATALOGART, " | |||
lv_no_match_in_range | TYPE QPGR, " | |||
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_no_authority_check | TYPE QM00-QKZ, " | |||
lv_i_codegruppe | TYPE QPGR-CODEGRUPPE, " | |||
lt_t_codegrptab | TYPE STANDARD TABLE OF QPK1CODEGRP, " | |||
lv_no_user_selection | TYPE QPK1CODEGRP, " | |||
lv_i_code | TYPE QPCD-CODE, " '*' | |||
lv_no_authorization | TYPE QPCD, " | |||
lv_i_sprache | TYPE QPGT-SPRACHE, " SY-LANGU | |||
lv_no_selection_specified | TYPE QPGT, " | |||
lv_i_winx1 | TYPE SY-WINX1, " 10 | |||
lv_object_locked | TYPE SY, " | |||
lv_i_winx2 | TYPE SY-WINX2, " 70 | |||
lv_lock_error | TYPE SY, " | |||
lv_i_winy1 | TYPE SY-WINY1, " 5 | |||
lv_object_missing | TYPE SY, " | |||
lv_i_winy2 | TYPE SY-WINY2, " 25 | |||
lv_i_display_mode | TYPE QM00-QKZ. " |
  CALL FUNCTION 'QPK1_GP_CODE_SELECTION' "Selection of several codes |
EXPORTING | ||
I_KATALOGART | = lv_i_katalogart | |
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_NO_AUTHORITY_CHECK | = lv_i_no_authority_check | |
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 | |
I_WINY2 | = lv_i_winy2 | |
I_DISPLAY_MODE | = lv_i_display_mode | |
TABLES | ||
T_QPK1CDTAB | = lt_t_qpk1cdtab | |
T_CODEGRPTAB | = lt_t_codegrptab | |
EXCEPTIONS | ||
NO_MATCH_IN_RANGE = 1 | ||
NO_USER_SELECTION = 2 | ||
NO_AUTHORIZATION = 3 | ||
NO_SELECTION_SPECIFIED = 4 | ||
OBJECT_LOCKED = 5 | ||
LOCK_ERROR = 6 | ||
OBJECT_MISSING = 7 | ||
. " QPK1_GP_CODE_SELECTION |
ABAP code using 7.40 inline data declarations to call FM QPK1_GP_CODE_SELECTION
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 QPGR INTO @DATA(ld_i_katalogart). | ||||
"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 QKZ FROM QM00 INTO @DATA(ld_i_no_authority_check). | ||||
"SELECT single CODEGRUPPE FROM QPGR INTO @DATA(ld_i_codegruppe). | ||||
"SELECT single CODE FROM QPCD INTO @DATA(ld_i_code). | ||||
DATA(ld_i_code) | = '*'. | |||
"SELECT single SPRACHE FROM QPGT 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. | |||
"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). | ||||
Search for further information about these or an SAP related objects