SAP MENU_GET_REPORTING_TREE Function Module for Fill Specified Reporting Tree in the Session Manager Tables
MENU_GET_REPORTING_TREE is a standard menu get reporting tree SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Fill Specified Reporting Tree in the Session Manager Tables 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 menu get reporting tree FM, simply by entering the name MENU_GET_REPORTING_TREE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SMNV
Program Name: SAPLSMNV
Main Program: SAPLSMNV
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MENU_GET_REPORTING_TREE 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 'MENU_GET_REPORTING_TREE'"Fill Specified Reporting Tree in the Session Manager Tables.
EXPORTING
* REPORTING_TREE = 'SAP1' "
* START_ID = 40000 "
* CUSTOMIZED = 'S' "
* PARENT_MENU = 'MENUS000' "
* IDENTIFY_CUST_OBJECTS = 'X' "
TABLES
OUTPUT_NODES = "
OUTPUT_TEXTS = "
IMPORTING Parameters details for MENU_GET_REPORTING_TREE
REPORTING_TREE -
Data type: SERPTREE-TREE_IDDefault: 'SAP1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
START_ID -
Data type: SMENSAPNEW-OBJECT_IDDefault: 40000
Optional: Yes
Call by Reference: No ( called with pass by value option)
CUSTOMIZED -
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'S'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PARENT_MENU -
Data type: CDefault: 'MENUS000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IDENTIFY_CUST_OBJECTS -
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MENU_GET_REPORTING_TREE
OUTPUT_NODES -
Data type: SMENSAPNEWOptional: No
Call by Reference: No ( called with pass by value option)
OUTPUT_TEXTS -
Data type: SMENSAPTOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MENU_GET_REPORTING_TREE 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_output_nodes | TYPE STANDARD TABLE OF SMENSAPNEW, " | |||
| lv_reporting_tree | TYPE SERPTREE-TREE_ID, " 'SAP1' | |||
| lv_start_id | TYPE SMENSAPNEW-OBJECT_ID, " 40000 | |||
| lt_output_texts | TYPE STANDARD TABLE OF SMENSAPT, " | |||
| lv_customized | TYPE SMENSAPNEW-CUSTOMIZED, " 'S' | |||
| lv_parent_menu | TYPE C, " 'MENUS000' | |||
| lv_identify_cust_objects | TYPE SMENSAPNEW-CUSTOMIZED. " 'X' |
|   CALL FUNCTION 'MENU_GET_REPORTING_TREE' "Fill Specified Reporting Tree in the Session Manager Tables |
| EXPORTING | ||
| REPORTING_TREE | = lv_reporting_tree | |
| START_ID | = lv_start_id | |
| CUSTOMIZED | = lv_customized | |
| PARENT_MENU | = lv_parent_menu | |
| IDENTIFY_CUST_OBJECTS | = lv_identify_cust_objects | |
| TABLES | ||
| OUTPUT_NODES | = lt_output_nodes | |
| OUTPUT_TEXTS | = lt_output_texts | |
| . " MENU_GET_REPORTING_TREE | ||
ABAP code using 7.40 inline data declarations to call FM MENU_GET_REPORTING_TREE
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 TREE_ID FROM SERPTREE INTO @DATA(ld_reporting_tree). | ||||
| DATA(ld_reporting_tree) | = 'SAP1'. | |||
| "SELECT single OBJECT_ID FROM SMENSAPNEW INTO @DATA(ld_start_id). | ||||
| DATA(ld_start_id) | = 40000. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_customized). | ||||
| DATA(ld_customized) | = 'S'. | |||
| DATA(ld_parent_menu) | = 'MENUS000'. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_identify_cust_objects). | ||||
| DATA(ld_identify_cust_objects) | = 'X'. | |||
Search for further information about these or an SAP related objects