SAP K_GROUP_CREATE Function Module for
K_GROUP_CREATE is a standard k group create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 create FM, simply by entering the name K_GROUP_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: KKH1
Program Name: SAPLKKH1
Main Program: SAPLKKH1
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function K_GROUP_CREATE 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_CREATE'".
EXPORTING
SETID = "
* OVERWRITE_MODE = '1' "
* VIA_POPUP = 'X' "
* SHOW_CHANGED_GROUP = 'X' "
TABLES
SETMASTERS = "
EXCEPTIONS
WRONG_SETCLASS = 1 CONVERT_ERROR = 10 GROUP_AMBIGUITY = 11 POPUP_ERROR = 12 F4_ERROR = 13 ACTION_CANCELED = 14 ENCRYPT_ERROR = 15 WRONG_GROUPNAME = 16 SETID_WITHOUT_SHORTNAME = 17 CO_AREA_ERROR = 2 WRONG_CH_OF_ACCOUNTS = 3 SET_ERROR = 4 GENERATE_ERROR = 5 OVERWRITE_FORBIDDEN = 6 NO_AUTHORITY = 7 ENQUEUE_ERROR = 8 FIELD_ERROR = 9
IMPORTING Parameters details for K_GROUP_CREATE
SETID -
Data type: SETIDOptional: No
Call by Reference: Yes
OVERWRITE_MODE -
Data type: XFLAGDefault: '1'
Optional: Yes
Call by Reference: Yes
VIA_POPUP -
Data type: XFLAGDefault: 'X'
Optional: Yes
Call by Reference: Yes
SHOW_CHANGED_GROUP -
Data type: XFLAGDefault: 'X'
Optional: Yes
Call by Reference: Yes
TABLES Parameters details for K_GROUP_CREATE
SETMASTERS -
Data type: RGSBVOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
WRONG_SETCLASS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CONVERT_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GROUP_AMBIGUITY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
POPUP_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
F4_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ACTION_CANCELED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ENCRYPT_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_GROUPNAME -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SETID_WITHOUT_SHORTNAME -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CO_AREA_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_CH_OF_ACCOUNTS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SET_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GENERATE_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OVERWRITE_FORBIDDEN -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ENQUEUE_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FIELD_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_GROUP_CREATE 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_setid | TYPE SETID, " | |||
| lt_setmasters | TYPE STANDARD TABLE OF RGSBV, " | |||
| lv_wrong_setclass | TYPE RGSBV, " | |||
| lv_convert_error | TYPE RGSBV, " | |||
| lv_group_ambiguity | TYPE RGSBV, " | |||
| lv_popup_error | TYPE RGSBV, " | |||
| lv_f4_error | TYPE RGSBV, " | |||
| lv_action_canceled | TYPE RGSBV, " | |||
| lv_encrypt_error | TYPE RGSBV, " | |||
| lv_wrong_groupname | TYPE RGSBV, " | |||
| lv_setid_without_shortname | TYPE RGSBV, " | |||
| lv_co_area_error | TYPE RGSBV, " | |||
| lv_overwrite_mode | TYPE XFLAG, " '1' | |||
| lv_via_popup | TYPE XFLAG, " 'X' | |||
| lv_wrong_ch_of_accounts | TYPE XFLAG, " | |||
| lv_set_error | TYPE XFLAG, " | |||
| lv_show_changed_group | TYPE XFLAG, " 'X' | |||
| lv_generate_error | TYPE XFLAG, " | |||
| lv_overwrite_forbidden | TYPE XFLAG, " | |||
| lv_no_authority | TYPE XFLAG, " | |||
| lv_enqueue_error | TYPE XFLAG, " | |||
| lv_field_error | TYPE XFLAG. " |
|   CALL FUNCTION 'K_GROUP_CREATE' " |
| EXPORTING | ||
| SETID | = lv_setid | |
| OVERWRITE_MODE | = lv_overwrite_mode | |
| VIA_POPUP | = lv_via_popup | |
| SHOW_CHANGED_GROUP | = lv_show_changed_group | |
| TABLES | ||
| SETMASTERS | = lt_setmasters | |
| EXCEPTIONS | ||
| WRONG_SETCLASS = 1 | ||
| CONVERT_ERROR = 10 | ||
| GROUP_AMBIGUITY = 11 | ||
| POPUP_ERROR = 12 | ||
| F4_ERROR = 13 | ||
| ACTION_CANCELED = 14 | ||
| ENCRYPT_ERROR = 15 | ||
| WRONG_GROUPNAME = 16 | ||
| SETID_WITHOUT_SHORTNAME = 17 | ||
| CO_AREA_ERROR = 2 | ||
| WRONG_CH_OF_ACCOUNTS = 3 | ||
| SET_ERROR = 4 | ||
| GENERATE_ERROR = 5 | ||
| OVERWRITE_FORBIDDEN = 6 | ||
| NO_AUTHORITY = 7 | ||
| ENQUEUE_ERROR = 8 | ||
| FIELD_ERROR = 9 | ||
| . " K_GROUP_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM K_GROUP_CREATE
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_overwrite_mode) | = '1'. | |||
| DATA(ld_via_popup) | = 'X'. | |||
| DATA(ld_show_changed_group) | = 'X'. | |||
Search for further information about these or an SAP related objects