SAP CODE_SELECTION Function Module for Code Selektion aus Katalog/Codegruppe/Codes









CODE_SELECTION is a standard 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 Code Selektion aus Katalog/Codegruppe/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 code selection FM, simply by entering the name CODE_SELECTION into the relevant SAP transaction such as SE37 or SE38.

Function Group: IWO0
Program Name: SAPLIWO0
Main Program: SAPLIWO0
Appliation area: I
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function 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 'CODE_SELECTION'"Code Selektion aus Katalog/Codegruppe/Codes
EXPORTING
* AKTYP = 'V' "Activity types A/V/H
CDGRP = "Code group
* CODE = ' ' "Codes
* IMSGTY = 'E' "
KTART = "Catalog type
* MODE = ' ' "Check (=X) or selection (= ' ')
QARTG = "T352B code group
* STEUER = 'P' "Individual selection (=P), display (=A), multiple selection (=C)
* VERSN = ' ' "Versions no. of the code

TABLES
IQKAT = "Selected codes
.



IMPORTING Parameters details for CODE_SELECTION

AKTYP - Activity types A/V/H

Data type: T365-AKTYP
Default: 'V'
Optional: Yes
Call by Reference: No ( called with pass by value option)

CDGRP - Code group

Data type: QKAT-CODEGRUPPE
Optional: No
Call by Reference: No ( called with pass by value option)

CODE - Codes

Data type: QKAT-CODE
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IMSGTY -

Data type: SY-MSGTY
Default: 'E'
Optional: Yes
Call by Reference: No ( called with pass by value option)

KTART - Catalog type

Data type: QKAT-KATALOGART
Optional: No
Call by Reference: No ( called with pass by value option)

MODE - Check (=X) or selection (= ' ')

Data type: RIWO00-SELEC
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

QARTG - T352B code group

Data type: QKAT-CODEGRUPPE
Optional: No
Call by Reference: No ( called with pass by value option)

STEUER - Individual selection (=P), display (=A), multiple selection (=C)

Data type: RIWO00-SELEC
Default: 'P'
Optional: Yes
Call by Reference: No ( called with pass by value option)

VERSN - Versions no. of the code

Data type: QKAT-VERSIONCD
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CODE_SELECTION

IQKAT - Selected codes

Data type: QKAT
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for 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:
lv_aktyp  TYPE T365-AKTYP, "   'V'
lt_iqkat  TYPE STANDARD TABLE OF QKAT, "   
lv_cdgrp  TYPE QKAT-CODEGRUPPE, "   
lv_code  TYPE QKAT-CODE, "   SPACE
lv_imsgty  TYPE SY-MSGTY, "   'E'
lv_ktart  TYPE QKAT-KATALOGART, "   
lv_mode  TYPE RIWO00-SELEC, "   SPACE
lv_qartg  TYPE QKAT-CODEGRUPPE, "   
lv_steuer  TYPE RIWO00-SELEC, "   'P'
lv_versn  TYPE QKAT-VERSIONCD. "   SPACE

  CALL FUNCTION 'CODE_SELECTION'  "Code Selektion aus Katalog/Codegruppe/Codes
    EXPORTING
         AKTYP = lv_aktyp
         CDGRP = lv_cdgrp
         CODE = lv_code
         IMSGTY = lv_imsgty
         KTART = lv_ktart
         MODE = lv_mode
         QARTG = lv_qartg
         STEUER = lv_steuer
         VERSN = lv_versn
    TABLES
         IQKAT = lt_iqkat
. " CODE_SELECTION




ABAP code using 7.40 inline data declarations to call FM 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 AKTYP FROM T365 INTO @DATA(ld_aktyp).
DATA(ld_aktyp) = 'V'.
 
 
"SELECT single CODEGRUPPE FROM QKAT INTO @DATA(ld_cdgrp).
 
"SELECT single CODE FROM QKAT INTO @DATA(ld_code).
DATA(ld_code) = ' '.
 
"SELECT single MSGTY FROM SY INTO @DATA(ld_imsgty).
DATA(ld_imsgty) = 'E'.
 
"SELECT single KATALOGART FROM QKAT INTO @DATA(ld_ktart).
 
"SELECT single SELEC FROM RIWO00 INTO @DATA(ld_mode).
DATA(ld_mode) = ' '.
 
"SELECT single CODEGRUPPE FROM QKAT INTO @DATA(ld_qartg).
 
"SELECT single SELEC FROM RIWO00 INTO @DATA(ld_steuer).
DATA(ld_steuer) = 'P'.
 
"SELECT single VERSIONCD FROM QKAT INTO @DATA(ld_versn).
DATA(ld_versn) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!