SAP G_SET_GENERATE Function Module for Call function module the set generation
G_SET_GENERATE is a standard g set generate SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Call function module the set generation 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 generate FM, simply by entering the name G_SET_GENERATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: GSGF
Program Name: SAPLGSGF
Main Program:
Appliation area:
Release date: 16-Aug-1999
Mode(Normal, Remote etc): Normal Function Module
Update:
Function G_SET_GENERATE 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_GENERATE'"Call function module the set generation.
EXPORTING
* CLIENT = ' ' "Client in which set is to be created
* LANGU = SY-LANGU "Set title language
SET_HEADER = "Specifications for the entire set
* TOLERATE_AMBIGUITY = ' ' "'X': Unambiguity indicator ignored
* NOTHING_CHANGED = ' ' "Internal use only (set not changed)
* FLAG_USE_RGSBS_USER = ' ' "Internal use (take user from header)
* REF_SET = ' ' "ID of reference set
TABLES
* FORMULA_LINES = "Table with formula lines
* SET_LINES_BASIC = "Table with basic set lines
* SET_LINES_DATA = "Table with data set lines
* SET_LINES_MULTI = "Table with multi set lines
* SET_LINES_SINGLE = "Table with single set lines
EXCEPTIONS
BAD_FORMULA = 1 SUBSET_HAS_WRONG_CLASS = 10 SUBSET_HAS_WRONG_DATA_ELEMENT = 11 SUBSET_HAS_WRONG_TYPE = 12 TABLE_OR_FIELDNAME_MISSING = 13 TEMPORARY_IN_PERMANENT_SET = 14 VARIABLE_DOES_NOT_EXIST = 15 VARIABLE_HAS_WRONG_DATA_ELEM = 16 VARIABLE_HAS_WRONG_TABLE = 17 VARIABLE_HAS_WRONG_TYPE = 18 WRONG_INTERVAL = 19 DOUBLE_FIELD = 2 WRONG_SETCLASS = 20 SUBSET_HAS_WRONG_TABLE = 21 ENTRY_NOT_FOUND = 3 NOT_UNIQUE = 4 OLD_SET_HAS_WRONG_DATA_ELEMENT = 5 OLD_SET_HAS_WRONG_TYPE = 6 SET_IS_RECURSIVE = 7 SETNAME_TOO_LONG = 8 SUBSET_DOES_NOT_EXIST = 9
IMPORTING Parameters details for G_SET_GENERATE
CLIENT - Client in which set is to be created
Data type: SY-MANDTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGU - Set title language
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
SET_HEADER - Specifications for the entire set
Data type: RGSBSOptional: No
Call by Reference: No ( called with pass by value option)
TOLERATE_AMBIGUITY - 'X': Unambiguity indicator ignored
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NOTHING_CHANGED - Internal use only (set not changed)
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLAG_USE_RGSBS_USER - Internal use (take user from header)
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
REF_SET - ID of reference set
Data type: RGSBS-SETNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for G_SET_GENERATE
FORMULA_LINES - Table with formula lines
Data type: RGSBFOptional: Yes
Call by Reference: No ( called with pass by value option)
SET_LINES_BASIC - Table with basic set lines
Data type: RGSBVOptional: Yes
Call by Reference: No ( called with pass by value option)
SET_LINES_DATA - Table with data set lines
Data type: RGSB3Optional: Yes
Call by Reference: No ( called with pass by value option)
SET_LINES_MULTI - Table with multi set lines
Data type: RGSB2Optional: Yes
Call by Reference: No ( called with pass by value option)
SET_LINES_SINGLE - Table with single set lines
Data type: RGSB1Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
BAD_FORMULA - Error in a formula
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SUBSET_HAS_WRONG_CLASS - Subset used has a different class
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SUBSET_HAS_WRONG_DATA_ELEMENT - Subset used has a different set data element
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SUBSET_HAS_WRONG_TYPE - Subset used has incorrect type (M/D)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLE_OR_FIELDNAME_MISSING - Table or field name has not been specified
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TEMPORARY_IN_PERMANENT_SET - Set contains temporary set
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIABLE_DOES_NOT_EXIST - Variable used does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIABLE_HAS_WRONG_DATA_ELEM - Variable used has a different set data element
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIABLE_HAS_WRONG_TABLE - Set variable belongs to wrong table
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIABLE_HAS_WRONG_TYPE - Variable used has incorrect type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_INTERVAL - Interval with From value > To Value
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DOUBLE_FIELD - Field used repeatedly in the set
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_SETCLASS - Incorrect set class (for M/D general sets only)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SUBSET_HAS_WRONG_TABLE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ENTRY_NOT_FOUND - Unknown entry
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_UNIQUE - Set is not unique, although required
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OLD_SET_HAS_WRONG_DATA_ELEMENT - Set with same name but different set data element
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OLD_SET_HAS_WRONG_TYPE - Set with same name but different type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SET_IS_RECURSIVE - Subset used contains the highest set
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SETNAME_TOO_LONG - Set name is too long for a temporary set
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SUBSET_DOES_NOT_EXIST - Subset used does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for G_SET_GENERATE 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_client | TYPE SY-MANDT, " SPACE | |||
lv_bad_formula | TYPE SY, " | |||
lt_formula_lines | TYPE STANDARD TABLE OF RGSBF, " | |||
lv_subset_has_wrong_class | TYPE RGSBF, " | |||
lv_subset_has_wrong_data_element | TYPE RGSBF, " | |||
lv_subset_has_wrong_type | TYPE RGSBF, " | |||
lv_table_or_fieldname_missing | TYPE RGSBF, " | |||
lv_temporary_in_permanent_set | TYPE RGSBF, " | |||
lv_variable_does_not_exist | TYPE RGSBF, " | |||
lv_variable_has_wrong_data_elem | TYPE RGSBF, " | |||
lv_variable_has_wrong_table | TYPE RGSBF, " | |||
lv_variable_has_wrong_type | TYPE RGSBF, " | |||
lv_wrong_interval | TYPE RGSBF, " | |||
lv_langu | TYPE SY-LANGU, " SY-LANGU | |||
lv_double_field | TYPE SY, " | |||
lt_set_lines_basic | TYPE STANDARD TABLE OF RGSBV, " | |||
lv_wrong_setclass | TYPE RGSBV, " | |||
lv_subset_has_wrong_table | TYPE RGSBV, " | |||
lv_set_header | TYPE RGSBS, " | |||
lt_set_lines_data | TYPE STANDARD TABLE OF RGSB3, " | |||
lv_entry_not_found | TYPE RGSB3, " | |||
lv_not_unique | TYPE RGSB3, " | |||
lt_set_lines_multi | TYPE STANDARD TABLE OF RGSB2, " | |||
lv_tolerate_ambiguity | TYPE SY-DATAR, " SPACE | |||
lv_nothing_changed | TYPE SY-DATAR, " SPACE | |||
lt_set_lines_single | TYPE STANDARD TABLE OF RGSB1, " | |||
lv_old_set_has_wrong_data_element | TYPE RGSB1, " | |||
lv_flag_use_rgsbs_user | TYPE SY-DATAR, " SPACE | |||
lv_old_set_has_wrong_type | TYPE SY, " | |||
lv_ref_set | TYPE RGSBS-SETNR, " SPACE | |||
lv_set_is_recursive | TYPE RGSBS, " | |||
lv_setname_too_long | TYPE RGSBS, " | |||
lv_subset_does_not_exist | TYPE RGSBS. " |
  CALL FUNCTION 'G_SET_GENERATE' "Call function module the set generation |
EXPORTING | ||
CLIENT | = lv_client | |
LANGU | = lv_langu | |
SET_HEADER | = lv_set_header | |
TOLERATE_AMBIGUITY | = lv_tolerate_ambiguity | |
NOTHING_CHANGED | = lv_nothing_changed | |
FLAG_USE_RGSBS_USER | = lv_flag_use_rgsbs_user | |
REF_SET | = lv_ref_set | |
TABLES | ||
FORMULA_LINES | = lt_formula_lines | |
SET_LINES_BASIC | = lt_set_lines_basic | |
SET_LINES_DATA | = lt_set_lines_data | |
SET_LINES_MULTI | = lt_set_lines_multi | |
SET_LINES_SINGLE | = lt_set_lines_single | |
EXCEPTIONS | ||
BAD_FORMULA = 1 | ||
SUBSET_HAS_WRONG_CLASS = 10 | ||
SUBSET_HAS_WRONG_DATA_ELEMENT = 11 | ||
SUBSET_HAS_WRONG_TYPE = 12 | ||
TABLE_OR_FIELDNAME_MISSING = 13 | ||
TEMPORARY_IN_PERMANENT_SET = 14 | ||
VARIABLE_DOES_NOT_EXIST = 15 | ||
VARIABLE_HAS_WRONG_DATA_ELEM = 16 | ||
VARIABLE_HAS_WRONG_TABLE = 17 | ||
VARIABLE_HAS_WRONG_TYPE = 18 | ||
WRONG_INTERVAL = 19 | ||
DOUBLE_FIELD = 2 | ||
WRONG_SETCLASS = 20 | ||
SUBSET_HAS_WRONG_TABLE = 21 | ||
ENTRY_NOT_FOUND = 3 | ||
NOT_UNIQUE = 4 | ||
OLD_SET_HAS_WRONG_DATA_ELEMENT = 5 | ||
OLD_SET_HAS_WRONG_TYPE = 6 | ||
SET_IS_RECURSIVE = 7 | ||
SETNAME_TOO_LONG = 8 | ||
SUBSET_DOES_NOT_EXIST = 9 | ||
. " G_SET_GENERATE |
ABAP code using 7.40 inline data declarations to call FM G_SET_GENERATE
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 MANDT FROM SY INTO @DATA(ld_client). | ||||
DATA(ld_client) | = ' '. | |||
"SELECT single LANGU FROM SY INTO @DATA(ld_langu). | ||||
DATA(ld_langu) | = SY-LANGU. | |||
"SELECT single DATAR FROM SY INTO @DATA(ld_tolerate_ambiguity). | ||||
DATA(ld_tolerate_ambiguity) | = ' '. | |||
"SELECT single DATAR FROM SY INTO @DATA(ld_nothing_changed). | ||||
DATA(ld_nothing_changed) | = ' '. | |||
"SELECT single DATAR FROM SY INTO @DATA(ld_flag_use_rgsbs_user). | ||||
DATA(ld_flag_use_rgsbs_user) | = ' '. | |||
"SELECT single SETNR FROM RGSBS INTO @DATA(ld_ref_set). | ||||
DATA(ld_ref_set) | = ' '. | |||
Search for further information about these or an SAP related objects