SAP K_GROUP_SELECT Function Module for Searching for cost-object groups via a pop-up window









K_GROUP_SELECT is a standard k group select SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Searching for cost-object groups via a pop-up window 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 k group select FM, simply by entering the name K_GROUP_SELECT into the relevant SAP transaction such as SE37 or SE38.

Function Group: KAB2
Program Name: SAPLKAB2
Main Program: SAPLKAB2
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function K_GROUP_SELECT 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 'K_GROUP_SELECT'"Searching for cost-object groups via a pop-up window
EXPORTING
* BUTTONS = 'X' "
* START_ROW = 5 "Start Line
* TABLE = 'CCSS' "
* TYPELIST = 'BS' "Defaults for the node type
* UPDUSER = '*' "
* KOKRS = "Controlling Area
* KTOPL = "Chart of Accounts
* FIKRS = "Financial Management Area
* CLASS = '0H ' "
* CRUSER = '*' "
FIELD_NAME = "Data base field name
* SEARCHFLD = ' ' "Search field known so far
* SEARCHFLD_INPUT = 'X' "Is search field ready for input?
* SEARCHFLD_REQUIRED = 'X' "Search field a required field? 'X'
* SET = '*' "
* START_COLUMN = 10 "Start Column

IMPORTING
CLASS_NAME = "Found object class
SET_NAME = "Found cost-object group
SET_TITLE = "Found object group name
TABLE_NAME = "Found table to which the cost-obje
SETID = "

EXCEPTIONS
NO_SET_PICKED = 1
.



IMPORTING Parameters details for K_GROUP_SELECT

BUTTONS -

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_ROW - Start Line

Data type:
Default: 5
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLE -

Data type: RGSBS-TABLE
Default: 'CCSS'
Optional: Yes
Call by Reference: No ( called with pass by value option)

TYPELIST - Defaults for the node type

Data type:
Default: 'BS'
Optional: Yes
Call by Reference: No ( called with pass by value option)

UPDUSER -

Data type: SETHEADER-UPDUSER
Default: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)

KOKRS - Controlling Area

Data type: TKA01-KOKRS
Optional: Yes
Call by Reference: No ( called with pass by value option)

KTOPL - Chart of Accounts

Data type: TKA01-KTOPL
Optional: Yes
Call by Reference: No ( called with pass by value option)

FIKRS - Financial Management Area

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

CLASS -

Data type: RGSBS-CLASS
Default: '0H '
Optional: Yes
Call by Reference: No ( called with pass by value option)

CRUSER -

Data type: SETHEADER-CREUSER
Default: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)

FIELD_NAME - Data base field name

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

SEARCHFLD - Search field known so far

Data type: RGSBS-SEARCHFLD
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

SEARCHFLD_INPUT - Is search field ready for input?

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SEARCHFLD_REQUIRED - Search field a required field? 'X'

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SET -

Data type: C
Default: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_COLUMN - Start Column

Data type:
Default: 10
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for K_GROUP_SELECT

CLASS_NAME - Found object class

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

SET_NAME - Found cost-object group

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

SET_TITLE - Found object group name

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

TABLE_NAME - Found table to which the cost-obje

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

SETID -

Data type: RGSBS-SETNR
Optional: No
Call by Reference: Yes

EXCEPTIONS details

NO_SET_PICKED - No group found or chosen

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

Copy and paste ABAP code example for K_GROUP_SELECT 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_buttons  TYPE STRING, "   'X'
lv_class_name  TYPE RGSBS-CLASS, "   
lv_no_set_picked  TYPE RGSBS, "   
lv_start_row  TYPE RGSBS, "   5
lv_table  TYPE RGSBS-TABLE, "   'CCSS'
lv_typelist  TYPE RGSBS, "   'BS'
lv_upduser  TYPE SETHEADER-UPDUSER, "   '*'
lv_kokrs  TYPE TKA01-KOKRS, "   
lv_ktopl  TYPE TKA01-KTOPL, "   
lv_fikrs  TYPE FIKRS, "   
lv_class  TYPE RGSBS-CLASS, "   '0H '
lv_set_name  TYPE C, "   
lv_cruser  TYPE SETHEADER-CREUSER, "   '*'
lv_set_title  TYPE RGSBS-TITLE, "   
lv_field_name  TYPE RGSBS-FIELD, "   
lv_table_name  TYPE RGSBS-TABLE, "   
lv_setid  TYPE RGSBS-SETNR, "   
lv_searchfld  TYPE RGSBS-SEARCHFLD, "   ' '
lv_searchfld_input  TYPE RGSBS, "   'X'
lv_searchfld_required  TYPE RGSBS, "   'X'
lv_set  TYPE C, "   '*'
lv_start_column  TYPE C. "   10

  CALL FUNCTION 'K_GROUP_SELECT'  "Searching for cost-object groups via a pop-up window
    EXPORTING
         BUTTONS = lv_buttons
         START_ROW = lv_start_row
         TABLE = lv_table
         TYPELIST = lv_typelist
         UPDUSER = lv_upduser
         KOKRS = lv_kokrs
         KTOPL = lv_ktopl
         FIKRS = lv_fikrs
         CLASS = lv_class
         CRUSER = lv_cruser
         FIELD_NAME = lv_field_name
         SEARCHFLD = lv_searchfld
         SEARCHFLD_INPUT = lv_searchfld_input
         SEARCHFLD_REQUIRED = lv_searchfld_required
         SET = lv_set
         START_COLUMN = lv_start_column
    IMPORTING
         CLASS_NAME = lv_class_name
         SET_NAME = lv_set_name
         SET_TITLE = lv_set_title
         TABLE_NAME = lv_table_name
         SETID = lv_setid
    EXCEPTIONS
        NO_SET_PICKED = 1
. " K_GROUP_SELECT




ABAP code using 7.40 inline data declarations to call FM K_GROUP_SELECT

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.

DATA(ld_buttons) = 'X'.
 
"SELECT single CLASS FROM RGSBS INTO @DATA(ld_class_name).
 
 
DATA(ld_start_row) = 5.
 
"SELECT single TABLE FROM RGSBS INTO @DATA(ld_table).
DATA(ld_table) = 'CCSS'.
 
DATA(ld_typelist) = 'BS'.
 
"SELECT single UPDUSER FROM SETHEADER INTO @DATA(ld_upduser).
DATA(ld_upduser) = '*'.
 
"SELECT single KOKRS FROM TKA01 INTO @DATA(ld_kokrs).
 
"SELECT single KTOPL FROM TKA01 INTO @DATA(ld_ktopl).
 
 
"SELECT single CLASS FROM RGSBS INTO @DATA(ld_class).
DATA(ld_class) = '0H '.
 
 
"SELECT single CREUSER FROM SETHEADER INTO @DATA(ld_cruser).
DATA(ld_cruser) = '*'.
 
"SELECT single TITLE FROM RGSBS INTO @DATA(ld_set_title).
 
"SELECT single FIELD FROM RGSBS INTO @DATA(ld_field_name).
 
"SELECT single TABLE FROM RGSBS INTO @DATA(ld_table_name).
 
"SELECT single SETNR FROM RGSBS INTO @DATA(ld_setid).
 
"SELECT single SEARCHFLD FROM RGSBS INTO @DATA(ld_searchfld).
DATA(ld_searchfld) = ' '.
 
DATA(ld_searchfld_input) = 'X'.
 
DATA(ld_searchfld_required) = 'X'.
 
DATA(ld_set) = '*'.
 
DATA(ld_start_column) = 10.
 


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!