SAP G_SET_FETCH Function Module for Importing a Set for the Purpose of Change
G_SET_FETCH is a standard g set fetch SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Importing a Set for the Purpose of Change 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 fetch FM, simply by entering the name G_SET_FETCH into the relevant SAP transaction such as SE37 or SE38.
Function Group: GSAC
Program Name: SAPLGSAC
Main Program: SAPLGSAC
Appliation area:
Release date: 18-Apr-2001
Mode(Normal, Remote etc): Normal Function Module
Update:
Function G_SET_FETCH 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_FETCH'"Importing a Set for the Purpose of Change.
EXPORTING
* CLASS = ' ' "
* LANGU = "
* NO_AUTHORITY_CHECK = ' ' "'X' --> no Authorization Check
SETNR = "
* SOURCE_CLIENT = "Source Client
* TABLE = ' ' "
* NO_TITLES = ' ' "'X' for Suppressing the Short Descriptions
* NO_SETID_CONVERSION = 'X' "Obsolete, do not use !!!
IMPORTING
SET_HEADER = "Specifications for the Entire 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
NO_AUTHORITY = 1 SET_IS_BROKEN = 2 SET_NOT_FOUND = 3
IMPORTING Parameters details for G_SET_FETCH
CLASS -
Data type: RGSBS-CLASSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGU -
Data type: SY-LANGUOptional: Yes
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY_CHECK - 'X' --> no Authorization Check
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SETNR -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
SOURCE_CLIENT - Source Client
Data type: SY-MANDTOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLE -
Data type: RGSBS-TABLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_TITLES - 'X' for Suppressing the Short Descriptions
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_SETID_CONVERSION - Obsolete, do not use !!!
Data type: SY-DATARDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for G_SET_FETCH
SET_HEADER - Specifications for the Entire Set
Data type: RGSBSOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for G_SET_FETCH
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
NO_AUTHORITY - No Authorization for Reading the Set
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SET_IS_BROKEN - Set is Damaged
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SET_NOT_FOUND - Set 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_FETCH 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_class | TYPE RGSBS-CLASS, " SPACE | |||
lv_set_header | TYPE RGSBS, " | |||
lv_no_authority | TYPE RGSBS, " | |||
lt_formula_lines | TYPE STANDARD TABLE OF RGSBF, " | |||
lv_langu | TYPE SY-LANGU, " | |||
lv_set_is_broken | TYPE SY, " | |||
lt_set_lines_basic | TYPE STANDARD TABLE OF RGSBV, " | |||
lv_set_not_found | TYPE RGSBV, " | |||
lt_set_lines_data | TYPE STANDARD TABLE OF RGSB3, " | |||
lv_no_authority_check | TYPE C, " SPACE | |||
lv_setnr | TYPE C, " | |||
lt_set_lines_multi | TYPE STANDARD TABLE OF RGSB2, " | |||
lv_source_client | TYPE SY-MANDT, " | |||
lt_set_lines_single | TYPE STANDARD TABLE OF RGSB1, " | |||
lv_table | TYPE RGSBS-TABLE, " SPACE | |||
lv_no_titles | TYPE C, " SPACE | |||
lv_no_setid_conversion | TYPE SY-DATAR. " 'X' |
  CALL FUNCTION 'G_SET_FETCH' "Importing a Set for the Purpose of Change |
EXPORTING | ||
CLASS | = lv_class | |
LANGU | = lv_langu | |
NO_AUTHORITY_CHECK | = lv_no_authority_check | |
SETNR | = lv_setnr | |
SOURCE_CLIENT | = lv_source_client | |
TABLE | = lv_table | |
NO_TITLES | = lv_no_titles | |
NO_SETID_CONVERSION | = lv_no_setid_conversion | |
IMPORTING | ||
SET_HEADER | = lv_set_header | |
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 | ||
NO_AUTHORITY = 1 | ||
SET_IS_BROKEN = 2 | ||
SET_NOT_FOUND = 3 | ||
. " G_SET_FETCH |
ABAP code using 7.40 inline data declarations to call FM G_SET_FETCH
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 CLASS FROM RGSBS INTO @DATA(ld_class). | ||||
DATA(ld_class) | = ' '. | |||
"SELECT single LANGU FROM SY INTO @DATA(ld_langu). | ||||
DATA(ld_no_authority_check) | = ' '. | |||
"SELECT single MANDT FROM SY INTO @DATA(ld_source_client). | ||||
"SELECT single TABLE FROM RGSBS INTO @DATA(ld_table). | ||||
DATA(ld_table) | = ' '. | |||
DATA(ld_no_titles) | = ' '. | |||
"SELECT single DATAR FROM SY INTO @DATA(ld_no_setid_conversion). | ||||
DATA(ld_no_setid_conversion) | = 'X'. | |||
Search for further information about these or an SAP related objects