SAP G_RW_GENERATE_REPORT_GROUP Function Module for Report Writer: Automatic Creation of a Report Group
G_RW_GENERATE_REPORT_GROUP is a standard g rw generate report group SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Report Writer: Automatic Creation of a Report Group 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 rw generate report group FM, simply by entering the name G_RW_GENERATE_REPORT_GROUP into the relevant SAP transaction such as SE37 or SE38.
Function Group: GRWY
Program Name: SAPLGRWY
Main Program: SAPLGRWY
Appliation area: G
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function G_RW_GENERATE_REPORT_GROUP 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_RW_GENERATE_REPORT_GROUP'"Report Writer: Automatic Creation of a Report Group.
EXPORTING
LIB = "Report library
REP = "Report
JOB = "Report group to be created
* GENERATE_CODE = 'X' "'X' = ABAP code for generating rep. group
TABLES
* REC_REPORTS = "List of receiver reports for drill-down
EXCEPTIONS
LIBRARY_NOT_FOUND = 1 REPORT_NOT_FOUND = 2 WRONG_JOB_NAME = 3 JOB_ALREADY_EXISTS = 4 NO_JOB_AUTHORITY = 5 ERROR_LOCKING_JOB = 6 UPDATE_FAILED = 7
IMPORTING Parameters details for G_RW_GENERATE_REPORT_GROUP
LIB - Report library
Data type: RGRWD-LIBOptional: No
Call by Reference: No ( called with pass by value option)
REP - Report
Data type: RGRWD-RNAMEOptional: No
Call by Reference: No ( called with pass by value option)
JOB - Report group to be created
Data type: RGRWJ-JOBOptional: No
Call by Reference: No ( called with pass by value option)
GENERATE_CODE - 'X' = ABAP code for generating rep. group
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for G_RW_GENERATE_REPORT_GROUP
REC_REPORTS - List of receiver reports for drill-down
Data type: RSTIRECOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
LIBRARY_NOT_FOUND - Library does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
REPORT_NOT_FOUND - Report does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_JOB_NAME - Report group name contains special characters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
JOB_ALREADY_EXISTS - Report group already exists
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_JOB_AUTHORITY - No authorization to create report groups
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_LOCKING_JOB - Error when blocking a report group
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UPDATE_FAILED - Error when saving report group
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for G_RW_GENERATE_REPORT_GROUP 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_lib | TYPE RGRWD-LIB, " | |||
| lt_rec_reports | TYPE STANDARD TABLE OF RSTIREC, " | |||
| lv_library_not_found | TYPE RSTIREC, " | |||
| lv_rep | TYPE RGRWD-RNAME, " | |||
| lv_report_not_found | TYPE RGRWD, " | |||
| lv_job | TYPE RGRWJ-JOB, " | |||
| lv_wrong_job_name | TYPE RGRWJ, " | |||
| lv_generate_code | TYPE C, " 'X' | |||
| lv_job_already_exists | TYPE C, " | |||
| lv_no_job_authority | TYPE C, " | |||
| lv_error_locking_job | TYPE C, " | |||
| lv_update_failed | TYPE C. " |
|   CALL FUNCTION 'G_RW_GENERATE_REPORT_GROUP' "Report Writer: Automatic Creation of a Report Group |
| EXPORTING | ||
| LIB | = lv_lib | |
| REP | = lv_rep | |
| JOB | = lv_job | |
| GENERATE_CODE | = lv_generate_code | |
| TABLES | ||
| REC_REPORTS | = lt_rec_reports | |
| EXCEPTIONS | ||
| LIBRARY_NOT_FOUND = 1 | ||
| REPORT_NOT_FOUND = 2 | ||
| WRONG_JOB_NAME = 3 | ||
| JOB_ALREADY_EXISTS = 4 | ||
| NO_JOB_AUTHORITY = 5 | ||
| ERROR_LOCKING_JOB = 6 | ||
| UPDATE_FAILED = 7 | ||
| . " G_RW_GENERATE_REPORT_GROUP | ||
ABAP code using 7.40 inline data declarations to call FM G_RW_GENERATE_REPORT_GROUP
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 LIB FROM RGRWD INTO @DATA(ld_lib). | ||||
| "SELECT single RNAME FROM RGRWD INTO @DATA(ld_rep). | ||||
| "SELECT single JOB FROM RGRWJ INTO @DATA(ld_job). | ||||
| DATA(ld_generate_code) | = 'X'. | |||
Search for further information about these or an SAP related objects