SAP SUBST_START_REPORT_IN_BATCH Function Module for Start an ABAP/4 Report With a New Variant in the Background
SUBST_START_REPORT_IN_BATCH is a standard subst start report in batch SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Start an ABAP/4 Report With a New Variant in the Background 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 subst start report in batch FM, simply by entering the name SUBST_START_REPORT_IN_BATCH into the relevant SAP transaction such as SE37 or SE38.
Function Group: SUGR
Program Name: SAPLSUGR
Main Program: SAPLSUGR
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function SUBST_START_REPORT_IN_BATCH 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 'SUBST_START_REPORT_IN_BATCH'"Start an ABAP/4 Report With a New Variant in the Background.
EXPORTING
* IV_JOBNAME = ' ' "Requested name of background job
* IV_VARIANTTEXT = 'Upgrade variant' "Short text of variant written
* IV_BATCHINSTANCE = ' ' "Name of targeted instance (see source code!)
IV_REPNAME = "Report to be called
* IV_VARNAME = 'SAP_UPGRADE' "Name of variant to be written
* IV_AUTHCKNAM = 'DDIC' "User under whom jo should run
* IV_BATCHHOST = ' ' "Host on which job should be started
* IV_LANGUAGE = SY-LANGU "Language under which job should run
* IS_PRIPARAMS = ' ' "Printer settings for job
* IV_SCHEDEVER = ' ' "Scheduling on other host if necessary
* IV_ABORT_ON_ERROR = ' ' "Raise exceptions instead of return
IMPORTING
EV_JOBCOUNT = "Job count of scheduled background job
EV_STARTRC = "Return code of scheduling attempt
EV_VARIWRC = "Return code of writing variant
TABLES
TT_REPORTPARAM = "Report parameters and select options
EXCEPTIONS
VARIANT_EXIST_CHECK_FAILED = 1 VARIANT_INSERT_VARIANT_EXISTS = 10 VARIANT_INSERT_VARIANT_LOCKED = 11 VARIANT_WRITE_FAILED = 12 NO_BATCH_SERVICE = 13 NO_SERVER_LIST = 14 BATCH_SCHEDULING_FAILED = 15 VARIANT_UPDATE_FAILED = 2 VARIANT_UPDATE_NOT_AUTHORIZED = 3 VARIANT_UPDATE_NO_REPORT = 4 VARIANT_UPDATE_NO_VARIANT = 5 VARIANT_UPDATE_VARIANT_LOCKED = 6 VARIANT_INSERT_FAILED = 7 VARIANT_INSERT_NOT_AUTHORIZED = 8 VARIANT_INSERT_NO_REPORT = 9
IMPORTING Parameters details for SUBST_START_REPORT_IN_BATCH
IV_JOBNAME - Requested name of background job
Data type: TBTCO-JOBNAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_VARIANTTEXT - Short text of variant written
Data type: VARIT-VTEXTDefault: 'Upgrade variant'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_BATCHINSTANCE - Name of targeted instance (see source code!)
Data type: TBTCO-JOBLOGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_REPNAME - Report to be called
Data type: SY-REPIDOptional: No
Call by Reference: No ( called with pass by value option)
IV_VARNAME - Name of variant to be written
Data type: RALDB-VARIANTDefault: 'SAP_UPGRADE'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_AUTHCKNAM - User under whom jo should run
Data type: TBTCJOB-AUTHCKNAMDefault: 'DDIC'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_BATCHHOST - Host on which job should be started
Data type: TBTCO-BTCSYSTEMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_LANGUAGE - Language under which job should run
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
IS_PRIPARAMS - Printer settings for job
Data type: PRI_PARAMSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_SCHEDEVER - Scheduling on other host if necessary
Data type: GSUGI_PA-W_TADIRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_ABORT_ON_ERROR - Raise exceptions instead of return
Data type: GSUGI_PA-W_TADIRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SUBST_START_REPORT_IN_BATCH
EV_JOBCOUNT - Job count of scheduled background job
Data type: TBTCO-JOBCOUNTOptional: No
Call by Reference: No ( called with pass by value option)
EV_STARTRC - Return code of scheduling attempt
Data type: SY-SUBRCOptional: No
Call by Reference: No ( called with pass by value option)
EV_VARIWRC - Return code of writing variant
Data type: SY-SUBRCOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SUBST_START_REPORT_IN_BATCH
TT_REPORTPARAM - Report parameters and select options
Data type: RSPARAMSOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
VARIANT_EXIST_CHECK_FAILED - Error during existence check of variant
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_INSERT_VARIANT_EXISTS - Variant has already been created
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_INSERT_VARIANT_LOCKED - Variant locked
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_WRITE_FAILED - Unknown error writing variant
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_BATCH_SERVICE - No process for background job
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_SERVER_LIST - List of Apservers not available
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
BATCH_SCHEDULING_FAILED - Error scheduling background job
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_UPDATE_FAILED - Error updating variant
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_UPDATE_NOT_AUTHORIZED - No authorization for variant maintenance
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_UPDATE_NO_REPORT - Report for variant does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_UPDATE_NO_VARIANT - Variant was deleted
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_UPDATE_VARIANT_LOCKED - Variant locked
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_INSERT_FAILED - Error creating variant
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_INSERT_NOT_AUTHORIZED - No authorization to create variant
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VARIANT_INSERT_NO_REPORT - Report for variant does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SUBST_START_REPORT_IN_BATCH 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_iv_jobname | TYPE TBTCO-JOBNAME, " SPACE | |||
| lv_ev_jobcount | TYPE TBTCO-JOBCOUNT, " | |||
| lt_tt_reportparam | TYPE STANDARD TABLE OF RSPARAMS, " | |||
| lv_variant_exist_check_failed | TYPE RSPARAMS, " | |||
| lv_iv_varianttext | TYPE VARIT-VTEXT, " 'Upgrade variant' | |||
| lv_variant_insert_variant_exists | TYPE VARIT, " | |||
| lv_iv_batchinstance | TYPE TBTCO-JOBLOG, " SPACE | |||
| lv_variant_insert_variant_locked | TYPE TBTCO, " | |||
| lv_variant_write_failed | TYPE TBTCO, " | |||
| lv_no_batch_service | TYPE TBTCO, " | |||
| lv_no_server_list | TYPE TBTCO, " | |||
| lv_batch_scheduling_failed | TYPE TBTCO, " | |||
| lv_ev_startrc | TYPE SY-SUBRC, " | |||
| lv_iv_repname | TYPE SY-REPID, " | |||
| lv_variant_update_failed | TYPE SY, " | |||
| lv_ev_variwrc | TYPE SY-SUBRC, " | |||
| lv_iv_varname | TYPE RALDB-VARIANT, " 'SAP_UPGRADE' | |||
| lv_variant_update_not_authorized | TYPE RALDB, " | |||
| lv_iv_authcknam | TYPE TBTCJOB-AUTHCKNAM, " 'DDIC' | |||
| lv_variant_update_no_report | TYPE TBTCJOB, " | |||
| lv_iv_batchhost | TYPE TBTCO-BTCSYSTEM, " SPACE | |||
| lv_variant_update_no_variant | TYPE TBTCO, " | |||
| lv_iv_language | TYPE SY-LANGU, " SY-LANGU | |||
| lv_variant_update_variant_locked | TYPE SY, " | |||
| lv_is_priparams | TYPE PRI_PARAMS, " SPACE | |||
| lv_variant_insert_failed | TYPE PRI_PARAMS, " | |||
| lv_iv_schedever | TYPE GSUGI_PA-W_TADIR, " SPACE | |||
| lv_variant_insert_not_authorized | TYPE GSUGI_PA, " | |||
| lv_iv_abort_on_error | TYPE GSUGI_PA-W_TADIR, " SPACE | |||
| lv_variant_insert_no_report | TYPE GSUGI_PA. " |
|   CALL FUNCTION 'SUBST_START_REPORT_IN_BATCH' "Start an ABAP/4 Report With a New Variant in the Background |
| EXPORTING | ||
| IV_JOBNAME | = lv_iv_jobname | |
| IV_VARIANTTEXT | = lv_iv_varianttext | |
| IV_BATCHINSTANCE | = lv_iv_batchinstance | |
| IV_REPNAME | = lv_iv_repname | |
| IV_VARNAME | = lv_iv_varname | |
| IV_AUTHCKNAM | = lv_iv_authcknam | |
| IV_BATCHHOST | = lv_iv_batchhost | |
| IV_LANGUAGE | = lv_iv_language | |
| IS_PRIPARAMS | = lv_is_priparams | |
| IV_SCHEDEVER | = lv_iv_schedever | |
| IV_ABORT_ON_ERROR | = lv_iv_abort_on_error | |
| IMPORTING | ||
| EV_JOBCOUNT | = lv_ev_jobcount | |
| EV_STARTRC | = lv_ev_startrc | |
| EV_VARIWRC | = lv_ev_variwrc | |
| TABLES | ||
| TT_REPORTPARAM | = lt_tt_reportparam | |
| EXCEPTIONS | ||
| VARIANT_EXIST_CHECK_FAILED = 1 | ||
| VARIANT_INSERT_VARIANT_EXISTS = 10 | ||
| VARIANT_INSERT_VARIANT_LOCKED = 11 | ||
| VARIANT_WRITE_FAILED = 12 | ||
| NO_BATCH_SERVICE = 13 | ||
| NO_SERVER_LIST = 14 | ||
| BATCH_SCHEDULING_FAILED = 15 | ||
| VARIANT_UPDATE_FAILED = 2 | ||
| VARIANT_UPDATE_NOT_AUTHORIZED = 3 | ||
| VARIANT_UPDATE_NO_REPORT = 4 | ||
| VARIANT_UPDATE_NO_VARIANT = 5 | ||
| VARIANT_UPDATE_VARIANT_LOCKED = 6 | ||
| VARIANT_INSERT_FAILED = 7 | ||
| VARIANT_INSERT_NOT_AUTHORIZED = 8 | ||
| VARIANT_INSERT_NO_REPORT = 9 | ||
| . " SUBST_START_REPORT_IN_BATCH | ||
ABAP code using 7.40 inline data declarations to call FM SUBST_START_REPORT_IN_BATCH
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 JOBNAME FROM TBTCO INTO @DATA(ld_iv_jobname). | ||||
| DATA(ld_iv_jobname) | = ' '. | |||
| "SELECT single JOBCOUNT FROM TBTCO INTO @DATA(ld_ev_jobcount). | ||||
| "SELECT single VTEXT FROM VARIT INTO @DATA(ld_iv_varianttext). | ||||
| DATA(ld_iv_varianttext) | = 'Upgrade variant'. | |||
| "SELECT single JOBLOG FROM TBTCO INTO @DATA(ld_iv_batchinstance). | ||||
| DATA(ld_iv_batchinstance) | = ' '. | |||
| "SELECT single SUBRC FROM SY INTO @DATA(ld_ev_startrc). | ||||
| "SELECT single REPID FROM SY INTO @DATA(ld_iv_repname). | ||||
| "SELECT single SUBRC FROM SY INTO @DATA(ld_ev_variwrc). | ||||
| "SELECT single VARIANT FROM RALDB INTO @DATA(ld_iv_varname). | ||||
| DATA(ld_iv_varname) | = 'SAP_UPGRADE'. | |||
| "SELECT single AUTHCKNAM FROM TBTCJOB INTO @DATA(ld_iv_authcknam). | ||||
| DATA(ld_iv_authcknam) | = 'DDIC'. | |||
| "SELECT single BTCSYSTEM FROM TBTCO INTO @DATA(ld_iv_batchhost). | ||||
| DATA(ld_iv_batchhost) | = ' '. | |||
| "SELECT single LANGU FROM SY INTO @DATA(ld_iv_language). | ||||
| DATA(ld_iv_language) | = SY-LANGU. | |||
| DATA(ld_is_priparams) | = ' '. | |||
| "SELECT single W_TADIR FROM GSUGI_PA INTO @DATA(ld_iv_schedever). | ||||
| DATA(ld_iv_schedever) | = ' '. | |||
| "SELECT single W_TADIR FROM GSUGI_PA INTO @DATA(ld_iv_abort_on_error). | ||||
| DATA(ld_iv_abort_on_error) | = ' '. | |||
Search for further information about these or an SAP related objects