SAP GRW_JOB_SUBMIT_PREPARE Function Module for Checks Status of and Generates Report Group (if Required)
GRW_JOB_SUBMIT_PREPARE is a standard grw job submit prepare SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Checks Status of and Generates Report Group (if Required) 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 grw job submit prepare FM, simply by entering the name GRW_JOB_SUBMIT_PREPARE into the relevant SAP transaction such as SE37 or SE38.
Function Group: GRWS
Program Name: SAPLGRWS
Main Program: SAPLGRWS
Appliation area: G
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function GRW_JOB_SUBMIT_PREPARE 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 'GRW_JOB_SUBMIT_PREPARE'"Checks Status of and Generates Report Group (if Required).
EXPORTING
I_REPORT_GROUP = "Report Group
* I_FORCE_GENERATION = ' ' "Force Generation
* I_IGNORE_AUTO_GENER = ' ' "Ignore 'Do not Generate Automatically' Indicator
* I_MESSAGE_LEVEL = 3 "1=I,S. 2=W. 3=E. 4=A Messages
* I_PROGRAM_TYPE = 'X' "Program Type
* I_NO_AUTHORITY_CHECK = ' ' "No Authorization Check
* I_NO_AUTO_IMPORT = ' ' "No Automatic Import of Standard Report Groups
IMPORTING
E_GENERATED = "General Flag
E_SUBRC = "Return Value, Return Value After ABAP Statements
ET_MESG = "Report Writer: Table for Collected Messages
E_PROGRAM_NAME = "ABAP Program Name
EXCEPTIONS
REPORT_GROUP_INVALID = 1 NO_AUTHORITY = 2 REPORT_GROUP_LOCKED = 3 PROGRAM_TYPE_INVALID = 4
IMPORTING Parameters details for GRW_JOB_SUBMIT_PREPARE
I_REPORT_GROUP - Report Group
Data type: RGJNROptional: No
Call by Reference: No ( called with pass by value option)
I_FORCE_GENERATION - Force Generation
Data type: FLAGDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_IGNORE_AUTO_GENER - Ignore 'Do not Generate Automatically' Indicator
Data type: FLAGDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MESSAGE_LEVEL - 1=I,S. 2=W. 3=E. 4=A Messages
Data type: SYSUBRCDefault: 3
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_PROGRAM_TYPE - Program Type
Data type: GRWJ_PROGTYPEDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_NO_AUTHORITY_CHECK - No Authorization Check
Data type: FLAGDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_NO_AUTO_IMPORT - No Automatic Import of Standard Report Groups
Data type: FLAGDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for GRW_JOB_SUBMIT_PREPARE
E_GENERATED - General Flag
Data type: FLAGOptional: No
Call by Reference: Yes
E_SUBRC - Return Value, Return Value After ABAP Statements
Data type: SYSUBRCOptional: No
Call by Reference: Yes
ET_MESG - Report Writer: Table for Collected Messages
Data type: TSMESGOptional: No
Call by Reference: Yes
E_PROGRAM_NAME - ABAP Program Name
Data type: PROGRAMMOptional: No
Call by Reference: Yes
EXCEPTIONS details
REPORT_GROUP_INVALID - Report Group Does Not Exist
Data type:Optional: No
Call by Reference: Yes
NO_AUTHORITY - No Authorization
Data type:Optional: No
Call by Reference: Yes
REPORT_GROUP_LOCKED - Report Group cannot be Locked for Generation
Data type:Optional: No
Call by Reference: Yes
PROGRAM_TYPE_INVALID - Incorrect Parameters
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for GRW_JOB_SUBMIT_PREPARE 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_e_generated | TYPE FLAG, " | |||
| lv_i_report_group | TYPE RGJNR, " | |||
| lv_report_group_invalid | TYPE RGJNR, " | |||
| lv_e_subrc | TYPE SYSUBRC, " | |||
| lv_no_authority | TYPE SYSUBRC, " | |||
| lv_i_force_generation | TYPE FLAG, " ' ' | |||
| lv_et_mesg | TYPE TSMESG, " | |||
| lv_i_ignore_auto_gener | TYPE FLAG, " ' ' | |||
| lv_report_group_locked | TYPE FLAG, " | |||
| lv_e_program_name | TYPE PROGRAMM, " | |||
| lv_i_message_level | TYPE SYSUBRC, " 3 | |||
| lv_program_type_invalid | TYPE SYSUBRC, " | |||
| lv_i_program_type | TYPE GRWJ_PROGTYPE, " 'X' | |||
| lv_i_no_authority_check | TYPE FLAG, " ' ' | |||
| lv_i_no_auto_import | TYPE FLAG. " ' ' |
|   CALL FUNCTION 'GRW_JOB_SUBMIT_PREPARE' "Checks Status of and Generates Report Group (if Required) |
| EXPORTING | ||
| I_REPORT_GROUP | = lv_i_report_group | |
| I_FORCE_GENERATION | = lv_i_force_generation | |
| I_IGNORE_AUTO_GENER | = lv_i_ignore_auto_gener | |
| I_MESSAGE_LEVEL | = lv_i_message_level | |
| I_PROGRAM_TYPE | = lv_i_program_type | |
| I_NO_AUTHORITY_CHECK | = lv_i_no_authority_check | |
| I_NO_AUTO_IMPORT | = lv_i_no_auto_import | |
| IMPORTING | ||
| E_GENERATED | = lv_e_generated | |
| E_SUBRC | = lv_e_subrc | |
| ET_MESG | = lv_et_mesg | |
| E_PROGRAM_NAME | = lv_e_program_name | |
| EXCEPTIONS | ||
| REPORT_GROUP_INVALID = 1 | ||
| NO_AUTHORITY = 2 | ||
| REPORT_GROUP_LOCKED = 3 | ||
| PROGRAM_TYPE_INVALID = 4 | ||
| . " GRW_JOB_SUBMIT_PREPARE | ||
ABAP code using 7.40 inline data declarations to call FM GRW_JOB_SUBMIT_PREPARE
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.| DATA(ld_i_force_generation) | = ' '. | |||
| DATA(ld_i_ignore_auto_gener) | = ' '. | |||
| DATA(ld_i_message_level) | = 3. | |||
| DATA(ld_i_program_type) | = 'X'. | |||
| DATA(ld_i_no_authority_check) | = ' '. | |||
| DATA(ld_i_no_auto_import) | = ' '. | |||
Search for further information about these or an SAP related objects