SAP G_SET_CREATION Function Module for Calls Set Maintenance Transaction for Creation
G_SET_CREATION is a standard g set creation SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Calls Set Maintenance Transaction for Creation 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 g set creation FM, simply by entering the name G_SET_CREATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: GSCM
Program Name: SAPLGSCM
Main Program: SAPLGSCM
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function G_SET_CREATION 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 'G_SET_CREATION'"Calls Set Maintenance Transaction for Creation.
EXPORTING
* SET_CLASS = '0000' "Set Class
* ECCS_DIMEN = "EC-CS Org. Unit
* ECCS_ITCLG = "EC-CS Chart of Accounts
* ECCS_SITYP = "EC-CS Subitem Category
* SUBCLASS = "Organizational Unit for 'Other' Set Classes
* USE_GROUP_MAINTENANCE = ' ' "'X': Use Group Maintenance for CO Groups
* CO_SET_ACCMODE = "
SET_NAME = "Set Name (not ID) of Set to be Created
TABLE = "Table for which the Set is to be Created
TYPES = "Set Types Allowed (BSMD)
* FIELD = ' ' "Field for New Set
* KOKRS = "Controlling Area for CO Groups
* FIKRS = "
* LIB = "Report Library for RW Sets Generated
* RNAME = "Report for Generated RW Sets
IMPORTING
NEW_SET = "Set ID (not Name) of the New Set
EXCEPTIONS
WRONG_TABLE = 1 GROUP_MAINTENANCE_ERROR = 10 WRONG_SET_NAME = 2 NO_SET_CREATED = 3 WRONG_SETCLASS = 4 SET_ALREADY_EXISTS = 5 WRONG_TYPE = 6 WRONG_FIELD = 7 NO_FIELD_PICKED = 8 NO_TYPE_PICKED = 9
IMPORTING Parameters details for G_SET_CREATION
SET_CLASS - Set Class
Data type: RGSBS-CLASSDefault: '0000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ECCS_DIMEN - EC-CS Org. Unit
Data type: SETHIER-ECCS_DIMENOptional: Yes
Call by Reference: No ( called with pass by value option)
ECCS_ITCLG - EC-CS Chart of Accounts
Data type: SETHIER-ECCS_ITCLGOptional: Yes
Call by Reference: No ( called with pass by value option)
ECCS_SITYP - EC-CS Subitem Category
Data type: SETHIER-ECCS_SITYPOptional: Yes
Call by Reference: No ( called with pass by value option)
SUBCLASS - Organizational Unit for 'Other' Set Classes
Data type: SETSUBCLSOptional: Yes
Call by Reference: No ( called with pass by value option)
USE_GROUP_MAINTENANCE - 'X': Use Group Maintenance for CO Groups
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CO_SET_ACCMODE -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
SET_NAME - Set Name (not ID) of Set to be Created
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
TABLE - Table for which the Set is to be Created
Data type: RGSBS-TABLEOptional: No
Call by Reference: No ( called with pass by value option)
TYPES - Set Types Allowed (BSMD)
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
FIELD - Field for New Set
Data type: RGSBS-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KOKRS - Controlling Area for CO Groups
Data type: SETHIER-KOKRSOptional: Yes
Call by Reference: No ( called with pass by value option)
FIKRS -
Data type: SETHIER-FIKRSOptional: Yes
Call by Reference: No ( called with pass by value option)
LIB - Report Library for RW Sets Generated
Data type: SETHIER-LIBOptional: Yes
Call by Reference: No ( called with pass by value option)
RNAME - Report for Generated RW Sets
Data type: SETHIER-RNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for G_SET_CREATION
NEW_SET - Set ID (not Name) of the New Set
Data type: RGSBS-SETNROptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
WRONG_TABLE - Table does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GROUP_MAINTENANCE_ERROR - Error Occurred During Group Maintenance
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_SET_NAME - Set Name is Invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_SET_CREATED - Set was not Created
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_SETCLASS - CO Groups may not be Created
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SET_ALREADY_EXISTS - Set already exists
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_TYPE - The Set Type transferred does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_FIELD - Table Field Transferred does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_FIELD_PICKED - No Table Field was Selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_TYPE_PICKED - Set Type was not Selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for G_SET_CREATION 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_new_set | TYPE RGSBS-SETNR, " | |||
| lv_set_class | TYPE RGSBS-CLASS, " '0000' | |||
| lv_wrong_table | TYPE RGSBS, " | |||
| lv_eccs_dimen | TYPE SETHIER-ECCS_DIMEN, " | |||
| lv_group_maintenance_error | TYPE SETHIER, " | |||
| lv_eccs_itclg | TYPE SETHIER-ECCS_ITCLG, " | |||
| lv_eccs_sityp | TYPE SETHIER-ECCS_SITYP, " | |||
| lv_subclass | TYPE SETSUBCLS, " | |||
| lv_use_group_maintenance | TYPE SY-DATAR, " SPACE | |||
| lv_co_set_accmode | TYPE C, " | |||
| lv_set_name | TYPE C, " | |||
| lv_wrong_set_name | TYPE C, " | |||
| lv_table | TYPE RGSBS-TABLE, " | |||
| lv_no_set_created | TYPE RGSBS, " | |||
| lv_types | TYPE C, " | |||
| lv_wrong_setclass | TYPE C, " | |||
| lv_field | TYPE RGSBS-FIELD, " SPACE | |||
| lv_set_already_exists | TYPE RGSBS, " | |||
| lv_kokrs | TYPE SETHIER-KOKRS, " | |||
| lv_wrong_type | TYPE SETHIER, " | |||
| lv_fikrs | TYPE SETHIER-FIKRS, " | |||
| lv_wrong_field | TYPE SETHIER, " | |||
| lv_lib | TYPE SETHIER-LIB, " | |||
| lv_no_field_picked | TYPE SETHIER, " | |||
| lv_rname | TYPE SETHIER-RNAME, " | |||
| lv_no_type_picked | TYPE SETHIER. " |
|   CALL FUNCTION 'G_SET_CREATION' "Calls Set Maintenance Transaction for Creation |
| EXPORTING | ||
| SET_CLASS | = lv_set_class | |
| ECCS_DIMEN | = lv_eccs_dimen | |
| ECCS_ITCLG | = lv_eccs_itclg | |
| ECCS_SITYP | = lv_eccs_sityp | |
| SUBCLASS | = lv_subclass | |
| USE_GROUP_MAINTENANCE | = lv_use_group_maintenance | |
| CO_SET_ACCMODE | = lv_co_set_accmode | |
| SET_NAME | = lv_set_name | |
| TABLE | = lv_table | |
| TYPES | = lv_types | |
| FIELD | = lv_field | |
| KOKRS | = lv_kokrs | |
| FIKRS | = lv_fikrs | |
| LIB | = lv_lib | |
| RNAME | = lv_rname | |
| IMPORTING | ||
| NEW_SET | = lv_new_set | |
| EXCEPTIONS | ||
| WRONG_TABLE = 1 | ||
| GROUP_MAINTENANCE_ERROR = 10 | ||
| WRONG_SET_NAME = 2 | ||
| NO_SET_CREATED = 3 | ||
| WRONG_SETCLASS = 4 | ||
| SET_ALREADY_EXISTS = 5 | ||
| WRONG_TYPE = 6 | ||
| WRONG_FIELD = 7 | ||
| NO_FIELD_PICKED = 8 | ||
| NO_TYPE_PICKED = 9 | ||
| . " G_SET_CREATION | ||
ABAP code using 7.40 inline data declarations to call FM G_SET_CREATION
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 SETNR FROM RGSBS INTO @DATA(ld_new_set). | ||||
| "SELECT single CLASS FROM RGSBS INTO @DATA(ld_set_class). | ||||
| DATA(ld_set_class) | = '0000'. | |||
| "SELECT single ECCS_DIMEN FROM SETHIER INTO @DATA(ld_eccs_dimen). | ||||
| "SELECT single ECCS_ITCLG FROM SETHIER INTO @DATA(ld_eccs_itclg). | ||||
| "SELECT single ECCS_SITYP FROM SETHIER INTO @DATA(ld_eccs_sityp). | ||||
| "SELECT single DATAR FROM SY INTO @DATA(ld_use_group_maintenance). | ||||
| DATA(ld_use_group_maintenance) | = ' '. | |||
| "SELECT single TABLE FROM RGSBS INTO @DATA(ld_table). | ||||
| "SELECT single FIELD FROM RGSBS INTO @DATA(ld_field). | ||||
| DATA(ld_field) | = ' '. | |||
| "SELECT single KOKRS FROM SETHIER INTO @DATA(ld_kokrs). | ||||
| "SELECT single FIKRS FROM SETHIER INTO @DATA(ld_fikrs). | ||||
| "SELECT single LIB FROM SETHIER INTO @DATA(ld_lib). | ||||
| "SELECT single RNAME FROM SETHIER INTO @DATA(ld_rname). | ||||
Search for further information about these or an SAP related objects