SAP SRT_CREATE_TCODE_FOR_REPORT Function Module for
SRT_CREATE_TCODE_FOR_REPORT is a standard srt create tcode for report 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 srt create tcode for report FM, simply by entering the name SRT_CREATE_TCODE_FOR_REPORT into the relevant SAP transaction such as SE37 or SE38.
Function Group: SRT2
Program Name: SAPLSRT2
Main Program: SAPLSRT2
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SRT_CREATE_TCODE_FOR_REPORT 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 'SRT_CREATE_TCODE_FOR_REPORT'".
EXPORTING
REPORT_STRUCTURE = "
* GENERATE_IMMEDIATELY = 'X' "
* ENABLE_WINGUI = 'X' "Windows 32
* ENABLE_WEBGUI = "SAPGUI for HTML
* ENABLE_PLATINGUI = "SAPGUI for Java
TCVAR_STRUCTURE = "
* PRESET_TCODE = ' ' "
* NO_EXISTENCE_CHECK = ' ' "
* GENERATE_TCODE = ' ' "
* GET_REPORT_TEXT = 'X' "
* TCODE_TEXT = "
* DEVCLASS = ' ' "
* TRKORR = ' ' "
IMPORTING
TCODE = "
REPORT_DESCRIPTION = "
EXCEPTIONS
NO_TCODE_GENERATED = 1
IMPORTING Parameters details for SRT_CREATE_TCODE_FOR_REPORT
REPORT_STRUCTURE -
Data type: SREPOVARIOptional: No
Call by Reference: No ( called with pass by value option)
GENERATE_IMMEDIATELY -
Data type:Default: 'X'
Optional: Yes
Call by Reference: Yes
ENABLE_WINGUI - Windows 32
Data type: S_WIN32Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ENABLE_WEBGUI - SAPGUI for HTML
Data type: S_WEBGUIOptional: Yes
Call by Reference: No ( called with pass by value option)
ENABLE_PLATINGUI - SAPGUI for Java
Data type: S_PLATINOptional: Yes
Call by Reference: No ( called with pass by value option)
TCVAR_STRUCTURE -
Data type: SRT_TCVAROptional: No
Call by Reference: No ( called with pass by value option)
PRESET_TCODE -
Data type: TSTC-TCODEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_EXISTENCE_CHECK -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
GENERATE_TCODE -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
GET_REPORT_TEXT -
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TCODE_TEXT -
Data type: TSTCT-TTEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
DEVCLASS -
Data type: DEVCLASSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TRKORR -
Data type: TRKORRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SRT_CREATE_TCODE_FOR_REPORT
TCODE -
Data type: TSTC-TCODEOptional: No
Call by Reference: No ( called with pass by value option)
REPORT_DESCRIPTION -
Data type: HIER_TEXTOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_TCODE_GENERATED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SRT_CREATE_TCODE_FOR_REPORT 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_tcode | TYPE TSTC-TCODE, " | |||
| lv_report_structure | TYPE SREPOVARI, " | |||
| lv_no_tcode_generated | TYPE SREPOVARI, " | |||
| lv_generate_immediately | TYPE SREPOVARI, " 'X' | |||
| lv_enable_wingui | TYPE S_WIN32, " 'X' | |||
| lv_enable_webgui | TYPE S_WEBGUI, " | |||
| lv_enable_platingui | TYPE S_PLATIN, " | |||
| lv_tcvar_structure | TYPE SRT_TCVAR, " | |||
| lv_report_description | TYPE HIER_TEXT, " | |||
| lv_preset_tcode | TYPE TSTC-TCODE, " SPACE | |||
| lv_no_existence_check | TYPE TSTC, " SPACE | |||
| lv_generate_tcode | TYPE TSTC, " SPACE | |||
| lv_get_report_text | TYPE TSTC, " 'X' | |||
| lv_tcode_text | TYPE TSTCT-TTEXT, " | |||
| lv_devclass | TYPE DEVCLASS, " SPACE | |||
| lv_trkorr | TYPE TRKORR. " SPACE |
|   CALL FUNCTION 'SRT_CREATE_TCODE_FOR_REPORT' " |
| EXPORTING | ||
| REPORT_STRUCTURE | = lv_report_structure | |
| GENERATE_IMMEDIATELY | = lv_generate_immediately | |
| ENABLE_WINGUI | = lv_enable_wingui | |
| ENABLE_WEBGUI | = lv_enable_webgui | |
| ENABLE_PLATINGUI | = lv_enable_platingui | |
| TCVAR_STRUCTURE | = lv_tcvar_structure | |
| PRESET_TCODE | = lv_preset_tcode | |
| NO_EXISTENCE_CHECK | = lv_no_existence_check | |
| GENERATE_TCODE | = lv_generate_tcode | |
| GET_REPORT_TEXT | = lv_get_report_text | |
| TCODE_TEXT | = lv_tcode_text | |
| DEVCLASS | = lv_devclass | |
| TRKORR | = lv_trkorr | |
| IMPORTING | ||
| TCODE | = lv_tcode | |
| REPORT_DESCRIPTION | = lv_report_description | |
| EXCEPTIONS | ||
| NO_TCODE_GENERATED = 1 | ||
| . " SRT_CREATE_TCODE_FOR_REPORT | ||
ABAP code using 7.40 inline data declarations to call FM SRT_CREATE_TCODE_FOR_REPORT
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 TCODE FROM TSTC INTO @DATA(ld_tcode). | ||||
| DATA(ld_generate_immediately) | = 'X'. | |||
| DATA(ld_enable_wingui) | = 'X'. | |||
| "SELECT single TCODE FROM TSTC INTO @DATA(ld_preset_tcode). | ||||
| DATA(ld_preset_tcode) | = ' '. | |||
| DATA(ld_no_existence_check) | = ' '. | |||
| DATA(ld_generate_tcode) | = ' '. | |||
| DATA(ld_get_report_text) | = 'X'. | |||
| "SELECT single TTEXT FROM TSTCT INTO @DATA(ld_tcode_text). | ||||
| DATA(ld_devclass) | = ' '. | |||
| DATA(ld_trkorr) | = ' '. | |||
Search for further information about these or an SAP related objects