SAP G_SET_GET_ID_FROM_NAME Function Module for
G_SET_GET_ID_FROM_NAME is a standard g set get id from name 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 g set get id from name FM, simply by entering the name G_SET_GET_ID_FROM_NAME into the relevant SAP transaction such as SE37 or SE38.
Function Group: GSAC
Program Name: SAPLGSAC
Main Program: SAPLGSAC
Appliation area: G
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function G_SET_GET_ID_FROM_NAME 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_GET_ID_FROM_NAME'".
EXPORTING
* CLIENT = "Client that is searched for sets
* SETCLASS = "Class of set searched for (mask +* possible)
* CHECK_SET_EMPTY = ' ' "Check whether set is empty or contains formulas
* SUPRESS_POPUP = ' ' "No popup, >1 set matches => exception NO_SET_PICK
* NO_DYNAMIC_SETS = ' ' "Dynamic sets are not allowed
SHORTNAME = "External name of set (not the ID!)
* OLD_SETID = "Set ID for repeated checks
* TABNAME = "Table for which set is used
* FIELDNAME = "Field for which set is used
* KOKRS = "Controlling area for CO groups
* KTOPL = "Chart of account for account group can be derived
* LIB = "RW report library (for generated sets)
* RNAME = "RW report (only for generated RW sets)
IMPORTING
NEW_SETID = "ID of set found
SET_INFO = "Information about set (only on demand)
TABLES
* T_SETS = "List of matching sets (only on demand)
EXCEPTIONS
NO_SET_FOUND = 1 NO_SET_PICKED_FROM_POPUP = 2 WRONG_CLASS = 3 WRONG_SUBCLASS = 4 TABLE_FIELD_NOT_FOUND = 5 FIELDS_DONT_MATCH = 6 SET_IS_EMPTY = 7 FORMULA_IN_SET = 8 SET_IS_DYNAMIC = 9
IMPORTING Parameters details for G_SET_GET_ID_FROM_NAME
CLIENT - Client that is searched for sets
Data type: SY-MANDTOptional: Yes
Call by Reference: No ( called with pass by value option)
SETCLASS - Class of set searched for (mask +* possible)
Data type: SETHEADER-SETCLASSOptional: Yes
Call by Reference: No ( called with pass by value option)
CHECK_SET_EMPTY - Check whether set is empty or contains formulas
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUPRESS_POPUP - No popup, >1 set matches => exception NO_SET_PICK
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_DYNAMIC_SETS - Dynamic sets are not allowed
Data type: SY-DATARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SHORTNAME - External name of set (not the ID!)
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
OLD_SETID - Set ID for repeated checks
Data type: SETHIER-SETIDOptional: Yes
Call by Reference: No ( called with pass by value option)
TABNAME - Table for which set is used
Data type: SETHIER-TABNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
FIELDNAME - Field for which set is used
Data type: SETHIER-FIELDNAMEOptional: 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)
KTOPL - Chart of account for account group can be derived
Data type: SETHIER-KTOPLOptional: Yes
Call by Reference: No ( called with pass by value option)
LIB - RW report library (for generated sets)
Data type: SETHIER-LIBOptional: Yes
Call by Reference: No ( called with pass by value option)
RNAME - RW report (only 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_GET_ID_FROM_NAME
NEW_SETID - ID of set found
Data type: SETHIER-SETIDOptional: No
Call by Reference: No ( called with pass by value option)
SET_INFO - Information about set (only on demand)
Data type: SETINFOOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for G_SET_GET_ID_FROM_NAME
T_SETS - List of matching sets (only on demand)
Data type: SETLISTOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_SET_FOUND - No set found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_SET_PICKED_FROM_POPUP - Several sets found bu none selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_CLASS - Set belongs to a different class
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_SUBCLASS - Set belongs to a different subclass
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLE_FIELD_NOT_FOUND - Table field does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FIELDS_DONT_MATCH - Set found but does not match table field
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SET_IS_EMPTY - The set found contains no entries
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FORMULA_IN_SET - The set found contains a formula
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SET_IS_DYNAMIC - Set is dynamic (if NO_DYNAMIC_SETS = 'X')
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for G_SET_GET_ID_FROM_NAME 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, " | |||
lt_t_sets | TYPE STANDARD TABLE OF SETLIST, " | |||
lv_new_setid | TYPE SETHIER-SETID, " | |||
lv_no_set_found | TYPE SETHIER, " | |||
lv_setclass | TYPE SETHEADER-SETCLASS, " | |||
lv_check_set_empty | TYPE SY-DATAR, " SPACE | |||
lv_supress_popup | TYPE SY-DATAR, " SPACE | |||
lv_no_dynamic_sets | TYPE SY-DATAR, " SPACE | |||
lv_set_info | TYPE SETINFO, " | |||
lv_shortname | TYPE C, " | |||
lv_no_set_picked_from_popup | TYPE C, " | |||
lv_old_setid | TYPE SETHIER-SETID, " | |||
lv_wrong_class | TYPE SETHIER, " | |||
lv_tabname | TYPE SETHIER-TABNAME, " | |||
lv_wrong_subclass | TYPE SETHIER, " | |||
lv_fieldname | TYPE SETHIER-FIELDNAME, " | |||
lv_table_field_not_found | TYPE SETHIER, " | |||
lv_kokrs | TYPE SETHIER-KOKRS, " | |||
lv_fields_dont_match | TYPE SETHIER, " | |||
lv_ktopl | TYPE SETHIER-KTOPL, " | |||
lv_set_is_empty | TYPE SETHIER, " | |||
lv_lib | TYPE SETHIER-LIB, " | |||
lv_formula_in_set | TYPE SETHIER, " | |||
lv_rname | TYPE SETHIER-RNAME, " | |||
lv_set_is_dynamic | TYPE SETHIER. " |
  CALL FUNCTION 'G_SET_GET_ID_FROM_NAME' " |
EXPORTING | ||
CLIENT | = lv_client | |
SETCLASS | = lv_setclass | |
CHECK_SET_EMPTY | = lv_check_set_empty | |
SUPRESS_POPUP | = lv_supress_popup | |
NO_DYNAMIC_SETS | = lv_no_dynamic_sets | |
SHORTNAME | = lv_shortname | |
OLD_SETID | = lv_old_setid | |
TABNAME | = lv_tabname | |
FIELDNAME | = lv_fieldname | |
KOKRS | = lv_kokrs | |
KTOPL | = lv_ktopl | |
LIB | = lv_lib | |
RNAME | = lv_rname | |
IMPORTING | ||
NEW_SETID | = lv_new_setid | |
SET_INFO | = lv_set_info | |
TABLES | ||
T_SETS | = lt_t_sets | |
EXCEPTIONS | ||
NO_SET_FOUND = 1 | ||
NO_SET_PICKED_FROM_POPUP = 2 | ||
WRONG_CLASS = 3 | ||
WRONG_SUBCLASS = 4 | ||
TABLE_FIELD_NOT_FOUND = 5 | ||
FIELDS_DONT_MATCH = 6 | ||
SET_IS_EMPTY = 7 | ||
FORMULA_IN_SET = 8 | ||
SET_IS_DYNAMIC = 9 | ||
. " G_SET_GET_ID_FROM_NAME |
ABAP code using 7.40 inline data declarations to call FM G_SET_GET_ID_FROM_NAME
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). | ||||
"SELECT single SETID FROM SETHIER INTO @DATA(ld_new_setid). | ||||
"SELECT single SETCLASS FROM SETHEADER INTO @DATA(ld_setclass). | ||||
"SELECT single DATAR FROM SY INTO @DATA(ld_check_set_empty). | ||||
DATA(ld_check_set_empty) | = ' '. | |||
"SELECT single DATAR FROM SY INTO @DATA(ld_supress_popup). | ||||
DATA(ld_supress_popup) | = ' '. | |||
"SELECT single DATAR FROM SY INTO @DATA(ld_no_dynamic_sets). | ||||
DATA(ld_no_dynamic_sets) | = ' '. | |||
"SELECT single SETID FROM SETHIER INTO @DATA(ld_old_setid). | ||||
"SELECT single TABNAME FROM SETHIER INTO @DATA(ld_tabname). | ||||
"SELECT single FIELDNAME FROM SETHIER INTO @DATA(ld_fieldname). | ||||
"SELECT single KOKRS FROM SETHIER INTO @DATA(ld_kokrs). | ||||
"SELECT single KTOPL FROM SETHIER INTO @DATA(ld_ktopl). | ||||
"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