SAP MENU_GET_OLD Function Module for Read the menu for user, position, ...
MENU_GET_OLD is a standard menu get old SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read the menu for user, position, ... 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 old FM, simply by entering the name MENU_GET_OLD into the relevant SAP transaction such as SE37 or SE38.
Function Group: SMNU
Program Name: SAPLSMNU
Main Program: SAPLSMNU
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function MENU_GET_OLD 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_OLD'"Read the menu for user, position, ....
EXPORTING
* USER_TYPE = 'US' "
* NEW_LINE = ' ' "
* USE_CRLF_SUBSTITUTE = 'X' "
* USER_NAME = SY-UNAME "User Name
* MENU_READ_FLAG = ' ' "
* SPRAS = SY-LANGU "
* CHECK_DATE = SY-DATUM "Comparison Date
* CHECK_TIME = SY-UZEIT "
* FORCE_MENU_LOAD = ' ' "
* DOWNLOAD_FILES = ' ' "
* SEPARATOR = ',' "
TABLES
MENU_STRUCTURE = "Menu structure
MENU_TEXTS = "Menu texts
EXCEPTIONS
MENU_NOT_FOUND = 1
IMPORTING Parameters details for MENU_GET_OLD
USER_TYPE -
Data type: SMENUSENEW-TYPDefault: 'US'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NEW_LINE -
Data type: SMENSAPNEW-CUSTOMIZEDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
USE_CRLF_SUBSTITUTE -
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
USER_NAME - User Name
Data type: SMENUSENEW-IDDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
MENU_READ_FLAG -
Data type: SMENUSENEW-TYPDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SPRAS -
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
CHECK_DATE - Comparison Date
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
CHECK_TIME -
Data type: SY-UZEITDefault: SY-UZEIT
Optional: Yes
Call by Reference: No ( called with pass by value option)
FORCE_MENU_LOAD -
Data type: SY-DATARDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
DOWNLOAD_FILES -
Data type: SMENSAPNEW-CUSTOMIZEDDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SEPARATOR -
Data type: SMENSAPNEW-CUSTOMIZEDDefault: ','
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MENU_GET_OLD
MENU_STRUCTURE - Menu structure
Data type: SMENSTRUOptional: No
Call by Reference: No ( called with pass by value option)
MENU_TEXTS - Menu texts
Data type: SMENSTRUOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
MENU_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MENU_GET_OLD 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_user_type | TYPE SMENUSENEW-TYP, " 'US' | |||
| lv_menu_not_found | TYPE SMENUSENEW, " | |||
| lt_menu_structure | TYPE STANDARD TABLE OF SMENSTRU, " | |||
| lv_new_line | TYPE SMENSAPNEW-CUSTOMIZED, " SPACE | |||
| lv_use_crlf_substitute | TYPE SMENSAPNEW-CUSTOMIZED, " 'X' | |||
| lv_user_name | TYPE SMENUSENEW-ID, " SY-UNAME | |||
| lt_menu_texts | TYPE STANDARD TABLE OF SMENSTRU, " | |||
| lv_menu_read_flag | TYPE SMENUSENEW-TYP, " ' ' | |||
| lv_spras | TYPE SY-LANGU, " SY-LANGU | |||
| lv_check_date | TYPE SY-DATUM, " SY-DATUM | |||
| lv_check_time | TYPE SY-UZEIT, " SY-UZEIT | |||
| lv_force_menu_load | TYPE SY-DATAR, " ' ' | |||
| lv_download_files | TYPE SMENSAPNEW-CUSTOMIZED, " ' ' | |||
| lv_separator | TYPE SMENSAPNEW-CUSTOMIZED. " ',' |
|   CALL FUNCTION 'MENU_GET_OLD' "Read the menu for user, position, ... |
| EXPORTING | ||
| USER_TYPE | = lv_user_type | |
| NEW_LINE | = lv_new_line | |
| USE_CRLF_SUBSTITUTE | = lv_use_crlf_substitute | |
| USER_NAME | = lv_user_name | |
| MENU_READ_FLAG | = lv_menu_read_flag | |
| SPRAS | = lv_spras | |
| CHECK_DATE | = lv_check_date | |
| CHECK_TIME | = lv_check_time | |
| FORCE_MENU_LOAD | = lv_force_menu_load | |
| DOWNLOAD_FILES | = lv_download_files | |
| SEPARATOR | = lv_separator | |
| TABLES | ||
| MENU_STRUCTURE | = lt_menu_structure | |
| MENU_TEXTS | = lt_menu_texts | |
| EXCEPTIONS | ||
| MENU_NOT_FOUND = 1 | ||
| . " MENU_GET_OLD | ||
ABAP code using 7.40 inline data declarations to call FM MENU_GET_OLD
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 TYP FROM SMENUSENEW INTO @DATA(ld_user_type). | ||||
| DATA(ld_user_type) | = 'US'. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_new_line). | ||||
| DATA(ld_new_line) | = ' '. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_use_crlf_substitute). | ||||
| DATA(ld_use_crlf_substitute) | = 'X'. | |||
| "SELECT single ID FROM SMENUSENEW INTO @DATA(ld_user_name). | ||||
| DATA(ld_user_name) | = SY-UNAME. | |||
| "SELECT single TYP FROM SMENUSENEW INTO @DATA(ld_menu_read_flag). | ||||
| DATA(ld_menu_read_flag) | = ' '. | |||
| "SELECT single LANGU FROM SY INTO @DATA(ld_spras). | ||||
| DATA(ld_spras) | = SY-LANGU. | |||
| "SELECT single DATUM FROM SY INTO @DATA(ld_check_date). | ||||
| DATA(ld_check_date) | = SY-DATUM. | |||
| "SELECT single UZEIT FROM SY INTO @DATA(ld_check_time). | ||||
| DATA(ld_check_time) | = SY-UZEIT. | |||
| "SELECT single DATAR FROM SY INTO @DATA(ld_force_menu_load). | ||||
| DATA(ld_force_menu_load) | = ' '. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_download_files). | ||||
| DATA(ld_download_files) | = ' '. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_separator). | ||||
| DATA(ld_separator) | = ','. | |||
Search for further information about these or an SAP related objects