SAP RS_SCREEN_FETCH Function Module for
RS_SCREEN_FETCH is a standard rs screen fetch 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 rs screen fetch FM, simply by entering the name RS_SCREEN_FETCH into the relevant SAP transaction such as SE37 or SE38.
Function Group: SEUS
Program Name: SAPLSEUS
Main Program: SAPLSEUS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RS_SCREEN_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 'RS_SCREEN_FETCH'".
EXPORTING
DYNNR_IMPORT = "Number of the current screen NUMC 4
* EXTEND_IMPORT = ' ' "'X' if current screen in customer enhancement mode
* WITH_ACTIVE_SOURCES_IMPORT = ' ' "
* IS_GENERATED_IMPORT = ' ' "
* IS_IN_WA_IMPORT = ' ' "
* IS_IN_FOREIGN_WA_IMPORT = ' ' "
* DYNPRO_TEXT_IMPORT = ' ' "Short text of the current screen CHAR 60
H_IMPORT = "Field string header of current screen
MODE_IMPORT = "Mode ('MODIFY', 'SHOW') current screen CHAR 6
MODIFIED_IMPORT = "'X' -> current screen is not saved CHAR 1
PROGNAME_IMPORT = "Module pool name of current screen CHAR 8
* DYNPRO_LANGUAGE_IMPORT = SY-LANGU "Language of short text of current screen LANG
* FETCH_THE_SAME_DYNPRO = ' ' "Get same screen (different mode)
* MODE_WANTED = ' ' "Mode ('MODIFY','SHOW') screen to be fetched CHAR 6
IMPORTING
DYNNR_EXPORT = "Number of the fetched screen NUMC 4
IS_GENERATED_EXPORT = "
IS_IN_WA_EXPORT = "
IS_IN_FOREIGN_WA_EXPORT = "
E_KORRNUM = "
E_NO_MODOFF = "
DYNPRO_TEXT_EXPORT = "Short text of the fetched screen CHAR 60
H_EXPORT = "Field string header of the fetched screen
MODE_EXPORT = "Mode ('MODIFY', 'SHOW') fetched screen CHAR 6
MODIFIED_EXPORT = "'X' -> current screen is not saved CHAR 1
PROGNAME_EXPORT = "Module pool name of fetched screen CHAR 8
NEW_MASTER_LANGUAGE = "Original language
EXTEND_EXPORT = "'X' if fetched screen in customer enhancement mode
WITH_ACTIVE_SOURCES_EXPORT = "
TABLES
E_G = "Flow logic
F_G = "Field list
M_G = "Matchcode subkeys
* SMODILOG_DYNP_G = "Customer enhancements
* SMODILOG_ABAP_G = "
* SMODISRC_PROT_ABAP_G = "
EXCEPTIONS
NOT_EXECUTED = 1 NOT_FOUND = 2
IMPORTING Parameters details for RS_SCREEN_FETCH
DYNNR_IMPORT - Number of the current screen NUMC 4
Data type: SY-DYNNROptional: No
Call by Reference: No ( called with pass by value option)
EXTEND_IMPORT - 'X' if current screen in customer enhancement mode
Data type: SY-CALLDDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITH_ACTIVE_SOURCES_IMPORT -
Data type: CDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IS_GENERATED_IMPORT -
Data type: CDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IS_IN_WA_IMPORT -
Data type: CDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IS_IN_FOREIGN_WA_IMPORT -
Data type: CDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
DYNPRO_TEXT_IMPORT - Short text of the current screen CHAR 60
Data type: D020T-DTXTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
H_IMPORT - Field string header of current screen
Data type: D020SOptional: No
Call by Reference: No ( called with pass by value option)
MODE_IMPORT - Mode ('MODIFY', 'SHOW') current screen CHAR 6
Data type: RS37A-MODEOptional: No
Call by Reference: No ( called with pass by value option)
MODIFIED_IMPORT - 'X' -> current screen is not saved CHAR 1
Data type: RS37A-FLAGOptional: No
Call by Reference: No ( called with pass by value option)
PROGNAME_IMPORT - Module pool name of current screen CHAR 8
Data type: SY-REPIDOptional: No
Call by Reference: No ( called with pass by value option)
DYNPRO_LANGUAGE_IMPORT - Language of short text of current screen LANG
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
FETCH_THE_SAME_DYNPRO - Get same screen (different mode)
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
MODE_WANTED - Mode ('MODIFY','SHOW') screen to be fetched CHAR 6
Data type: RS37A-MODEDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RS_SCREEN_FETCH
DYNNR_EXPORT - Number of the fetched screen NUMC 4
Data type: SY-DYNNROptional: No
Call by Reference: No ( called with pass by value option)
IS_GENERATED_EXPORT -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
IS_IN_WA_EXPORT -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
IS_IN_FOREIGN_WA_EXPORT -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
E_KORRNUM -
Data type: E070-TRKORROptional: No
Call by Reference: No ( called with pass by value option)
E_NO_MODOFF -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
DYNPRO_TEXT_EXPORT - Short text of the fetched screen CHAR 60
Data type: D020T-DTXTOptional: No
Call by Reference: No ( called with pass by value option)
H_EXPORT - Field string header of the fetched screen
Data type: D020SOptional: No
Call by Reference: No ( called with pass by value option)
MODE_EXPORT - Mode ('MODIFY', 'SHOW') fetched screen CHAR 6
Data type: RS37A-MODEOptional: No
Call by Reference: No ( called with pass by value option)
MODIFIED_EXPORT - 'X' -> current screen is not saved CHAR 1
Data type: RS37A-FLAGOptional: No
Call by Reference: No ( called with pass by value option)
PROGNAME_EXPORT - Module pool name of fetched screen CHAR 8
Data type: SY-REPIDOptional: No
Call by Reference: No ( called with pass by value option)
NEW_MASTER_LANGUAGE - Original language
Data type: SY-LANGUOptional: No
Call by Reference: No ( called with pass by value option)
EXTEND_EXPORT - 'X' if fetched screen in customer enhancement mode
Data type: SY-CALLDOptional: No
Call by Reference: No ( called with pass by value option)
WITH_ACTIVE_SOURCES_EXPORT -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RS_SCREEN_FETCH
E_G - Flow logic
Data type: DYN_FLOWLISTOptional: No
Call by Reference: Yes
F_G - Field list
Data type: D021SOptional: No
Call by Reference: No ( called with pass by value option)
M_G - Matchcode subkeys
Data type: D023SOptional: No
Call by Reference: No ( called with pass by value option)
SMODILOG_DYNP_G - Customer enhancements
Data type: SMODILOG_DOptional: Yes
Call by Reference: No ( called with pass by value option)
SMODILOG_ABAP_G -
Data type: SMODILOGOptional: Yes
Call by Reference: Yes
SMODISRC_PROT_ABAP_G -
Data type: SMODI_MOD_TABOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_EXECUTED - Fetch not executed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND - Screen to be fetched does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RS_SCREEN_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: | ||||
| lt_e_g | TYPE STANDARD TABLE OF DYN_FLOWLIST, " | |||
| lv_dynnr_export | TYPE SY-DYNNR, " | |||
| lv_dynnr_import | TYPE SY-DYNNR, " | |||
| lv_not_executed | TYPE SY, " | |||
| lv_extend_import | TYPE SY-CALLD, " ' ' | |||
| lv_is_generated_export | TYPE C, " | |||
| lv_is_in_wa_export | TYPE C, " | |||
| lv_with_active_sources_import | TYPE C, " ' ' | |||
| lv_is_generated_import | TYPE C, " ' ' | |||
| lv_is_in_foreign_wa_export | TYPE C, " | |||
| lv_e_korrnum | TYPE E070-TRKORR, " | |||
| lv_is_in_wa_import | TYPE C, " ' ' | |||
| lv_e_no_modoff | TYPE C, " | |||
| lv_is_in_foreign_wa_import | TYPE C, " ' ' | |||
| lt_f_g | TYPE STANDARD TABLE OF D021S, " | |||
| lv_not_found | TYPE D021S, " | |||
| lv_dynpro_text_export | TYPE D020T-DTXT, " | |||
| lv_dynpro_text_import | TYPE D020T-DTXT, " ' ' | |||
| lt_m_g | TYPE STANDARD TABLE OF D023S, " | |||
| lv_h_export | TYPE D020S, " | |||
| lv_h_import | TYPE D020S, " | |||
| lv_mode_export | TYPE RS37A-MODE, " | |||
| lv_mode_import | TYPE RS37A-MODE, " | |||
| lt_smodilog_dynp_g | TYPE STANDARD TABLE OF SMODILOG_D, " | |||
| lv_modified_export | TYPE RS37A-FLAG, " | |||
| lv_modified_import | TYPE RS37A-FLAG, " | |||
| lt_smodilog_abap_g | TYPE STANDARD TABLE OF SMODILOG, " | |||
| lv_progname_export | TYPE SY-REPID, " | |||
| lv_progname_import | TYPE SY-REPID, " | |||
| lt_smodisrc_prot_abap_g | TYPE STANDARD TABLE OF SMODI_MOD_TAB, " | |||
| lv_new_master_language | TYPE SY-LANGU, " | |||
| lv_dynpro_language_import | TYPE SY-LANGU, " SY-LANGU | |||
| lv_extend_export | TYPE SY-CALLD, " | |||
| lv_fetch_the_same_dynpro | TYPE SY, " ' ' | |||
| lv_mode_wanted | TYPE RS37A-MODE, " ' ' | |||
| lv_with_active_sources_export | TYPE C. " |
|   CALL FUNCTION 'RS_SCREEN_FETCH' " |
| EXPORTING | ||
| DYNNR_IMPORT | = lv_dynnr_import | |
| EXTEND_IMPORT | = lv_extend_import | |
| WITH_ACTIVE_SOURCES_IMPORT | = lv_with_active_sources_import | |
| IS_GENERATED_IMPORT | = lv_is_generated_import | |
| IS_IN_WA_IMPORT | = lv_is_in_wa_import | |
| IS_IN_FOREIGN_WA_IMPORT | = lv_is_in_foreign_wa_import | |
| DYNPRO_TEXT_IMPORT | = lv_dynpro_text_import | |
| H_IMPORT | = lv_h_import | |
| MODE_IMPORT | = lv_mode_import | |
| MODIFIED_IMPORT | = lv_modified_import | |
| PROGNAME_IMPORT | = lv_progname_import | |
| DYNPRO_LANGUAGE_IMPORT | = lv_dynpro_language_import | |
| FETCH_THE_SAME_DYNPRO | = lv_fetch_the_same_dynpro | |
| MODE_WANTED | = lv_mode_wanted | |
| IMPORTING | ||
| DYNNR_EXPORT | = lv_dynnr_export | |
| IS_GENERATED_EXPORT | = lv_is_generated_export | |
| IS_IN_WA_EXPORT | = lv_is_in_wa_export | |
| IS_IN_FOREIGN_WA_EXPORT | = lv_is_in_foreign_wa_export | |
| E_KORRNUM | = lv_e_korrnum | |
| E_NO_MODOFF | = lv_e_no_modoff | |
| DYNPRO_TEXT_EXPORT | = lv_dynpro_text_export | |
| H_EXPORT | = lv_h_export | |
| MODE_EXPORT | = lv_mode_export | |
| MODIFIED_EXPORT | = lv_modified_export | |
| PROGNAME_EXPORT | = lv_progname_export | |
| NEW_MASTER_LANGUAGE | = lv_new_master_language | |
| EXTEND_EXPORT | = lv_extend_export | |
| WITH_ACTIVE_SOURCES_EXPORT | = lv_with_active_sources_export | |
| TABLES | ||
| E_G | = lt_e_g | |
| F_G | = lt_f_g | |
| M_G | = lt_m_g | |
| SMODILOG_DYNP_G | = lt_smodilog_dynp_g | |
| SMODILOG_ABAP_G | = lt_smodilog_abap_g | |
| SMODISRC_PROT_ABAP_G | = lt_smodisrc_prot_abap_g | |
| EXCEPTIONS | ||
| NOT_EXECUTED = 1 | ||
| NOT_FOUND = 2 | ||
| . " RS_SCREEN_FETCH | ||
ABAP code using 7.40 inline data declarations to call FM RS_SCREEN_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 DYNNR FROM SY INTO @DATA(ld_dynnr_export). | ||||
| "SELECT single DYNNR FROM SY INTO @DATA(ld_dynnr_import). | ||||
| "SELECT single CALLD FROM SY INTO @DATA(ld_extend_import). | ||||
| DATA(ld_extend_import) | = ' '. | |||
| DATA(ld_with_active_sources_import) | = ' '. | |||
| DATA(ld_is_generated_import) | = ' '. | |||
| "SELECT single TRKORR FROM E070 INTO @DATA(ld_e_korrnum). | ||||
| DATA(ld_is_in_wa_import) | = ' '. | |||
| DATA(ld_is_in_foreign_wa_import) | = ' '. | |||
| "SELECT single DTXT FROM D020T INTO @DATA(ld_dynpro_text_export). | ||||
| "SELECT single DTXT FROM D020T INTO @DATA(ld_dynpro_text_import). | ||||
| DATA(ld_dynpro_text_import) | = ' '. | |||
| "SELECT single MODE FROM RS37A INTO @DATA(ld_mode_export). | ||||
| "SELECT single MODE FROM RS37A INTO @DATA(ld_mode_import). | ||||
| "SELECT single FLAG FROM RS37A INTO @DATA(ld_modified_export). | ||||
| "SELECT single FLAG FROM RS37A INTO @DATA(ld_modified_import). | ||||
| "SELECT single REPID FROM SY INTO @DATA(ld_progname_export). | ||||
| "SELECT single REPID FROM SY INTO @DATA(ld_progname_import). | ||||
| "SELECT single LANGU FROM SY INTO @DATA(ld_new_master_language). | ||||
| "SELECT single LANGU FROM SY INTO @DATA(ld_dynpro_language_import). | ||||
| DATA(ld_dynpro_language_import) | = SY-LANGU. | |||
| "SELECT single CALLD FROM SY INTO @DATA(ld_extend_export). | ||||
| DATA(ld_fetch_the_same_dynpro) | = ' '. | |||
| "SELECT single MODE FROM RS37A INTO @DATA(ld_mode_wanted). | ||||
| DATA(ld_mode_wanted) | = ' '. | |||
Search for further information about these or an SAP related objects