SAP Function Modules

MENU_SEARCH_MENU_TREE SAP Function module







MENU_SEARCH_MENU_TREE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name MENU_SEARCH_MENU_TREE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SMNU_NEW
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM MENU_SEARCH_MENU_TREE - MENU SEARCH MENU TREE





CALL FUNCTION 'MENU_SEARCH_MENU_TREE' "
  EXPORTING
    searchtext =                " text132       Explanatory text
*   menu_id =                   " ttree-id      GUID for Structure
*   search_menu_texts = 'X'     " char1         Single-Character Flag
*   search_tcodes = 'X'         " char1         Single-Character Flag
*   restrict_menu_search = ' '  " char1
*   menu_search_value =         " i
  TABLES
    found_nodes =               " bmenttree     Definition Table for Structures
    .  "  MENU_SEARCH_MENU_TREE

ABAP code example for Function Module MENU_SEARCH_MENU_TREE





The ABAP code below is a full code listing to execute function module MENU_SEARCH_MENU_TREE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_found_nodes  TYPE STANDARD TABLE OF BMENTTREE,"TABLES PARAM
wa_found_nodes  LIKE LINE OF it_found_nodes .

DATA(ld_searchtext) = 'Check type of data required'.

SELECT single ID
FROM TTREE
INTO @DATA(ld_menu_id).

DATA(ld_search_menu_texts) = 'Check type of data required'.
DATA(ld_search_tcodes) = 'Check type of data required'.
DATA(ld_restrict_menu_search) = 'Check type of data required'.
DATA(ld_menu_search_value) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_found_nodes to it_found_nodes. . CALL FUNCTION 'MENU_SEARCH_MENU_TREE' EXPORTING searchtext = ld_searchtext * menu_id = ld_menu_id * search_menu_texts = ld_search_menu_texts * search_tcodes = ld_search_tcodes * restrict_menu_search = ld_restrict_menu_search * menu_search_value = ld_menu_search_value TABLES found_nodes = it_found_nodes . " MENU_SEARCH_MENU_TREE
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_searchtext  TYPE TEXT132 ,
it_found_nodes  TYPE STANDARD TABLE OF BMENTTREE ,
wa_found_nodes  LIKE LINE OF it_found_nodes,
ld_menu_id  TYPE TTREE-ID ,
ld_search_menu_texts  TYPE CHAR1 ,
ld_search_tcodes  TYPE CHAR1 ,
ld_restrict_menu_search  TYPE CHAR1 ,
ld_menu_search_value  TYPE I .

ld_searchtext = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_found_nodes to it_found_nodes.

SELECT single ID
FROM TTREE
INTO ld_menu_id.

ld_search_menu_texts = 'Check type of data required'.
ld_search_tcodes = 'Check type of data required'.
ld_restrict_menu_search = 'Check type of data required'.
ld_menu_search_value = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name MENU_SEARCH_MENU_TREE or its description.