Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

area menu

Former Member
0 Likes
420

Hi Friends,

I want to 2 do a report which gives menu path if we give short description of program or standard report so for that i want 2 know in which table i get area menu but from TTREE table i cant access area menu becoz i dnt have id

2 REPLIES 2
Read only

Former Member
0 Likes
384

Hi,

Use tcode search_sap_menu to find the menu path for the transaction code

call this transactioncode from ur program

Regards,

Aparna

Read only

uwe_schieferstein
Active Contributor
0 Likes
384

Hello Satya

The following sample report may be helpful.

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_SAP_MENU_TCODES
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_sap_menu_tcodes.



DATA:
  gd_menupath      TYPE string,
  gs_input         TYPE smensapnew,
  gs_output        TYPE smensapnew,
  gs_output_text   TYPE smensapt,
*
  gt_select        TYPE STANDARD TABLE OF smenselect,
  gt_input         TYPE STANDARD TABLE OF smensapnew,
  gt_output        TYPE STANDARD TABLE OF smensapnew,
  gt_output_text   TYPE STANDARD TABLE OF smensapt.

PARAMETERS:
  p_tcode          TYPE tcode  DEFAULT 'SE39'.



START-OF-SELECTION.
  CALL FUNCTION 'MENU_BUILD_TREE_ADD_SELECTED'
*   EXPORTING
*     MENU_TYPE              = 'C'
*     LANGUAGE               = SY-LANGU
*     SELECT_TEXTS           = 'X'
*     USE_INPUT_TREE         = ' '
    TABLES
      marked_nodes           = gt_select
*     INPUT_TREE             =
      output_tree            = gt_output
      output_tree_text       = gt_output_text.

  READ TABLE gt_output INTO gs_output
       WITH KEY reporttype = 'TR'
                report     = p_tcode.
  CHECK ( syst-subrc = 0 ).

  INSERT gs_output INTO gt_input INDEX 1.
  DO.
    READ TABLE gt_output INTO gs_output
         WITH KEY object_id = gs_output-parent_id.
    IF ( syst-subrc NE 0 ).
      EXIT.
    ENDIF.

    INSERT gs_output INTO gt_input INDEX 1.
  ENDDO.

  WRITE: / 'Path to transaction', p_tcode, ':'.

  LOOP AT gt_input INTO gs_input.
    READ TABLE gt_output_text INTO gs_output_text
         WITH KEY object_id = gs_input-object_id.

    AT FIRST.
      gd_menupath = gs_output_text-text.
      CONTINUE.
    ENDAT.

*    AT LAST.
*      CONCATENATE gd_menupath gs_output_text-text INTO gd_menupath
*        SEPARATED BY space.
*      EXIT.
*    ENDAT.

    CONCATENATE gd_menupath '->' gs_output_text-text INTO gd_menupath
      SEPARATED BY space.
  ENDLOOP.

  CONCATENATE gd_menupath '(' p_tcode ')' INTO gd_menupath
    SEPARATED BY space.
  CONDENSE gd_menupath.

  WRITE: / gd_menupath.

END-OF-SELECTION.

Regards

Uwe