Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What area of ABAP are you interested in?
 
Home arrow Utilities arrow ABAP Utilities arrow Display menu path
Display menu path PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Anon.   
Saturday, 05 May 2007
Report that displays menu path REPORT Z_Display_menupath  NO STANDARD PAGE HEADING.

TABLES: SMENCUSNEW, SMENENTT, TSTC.
DATA: BEGIN OF ITAB OCCURS 10.
                 INCLUDE STRUCTURE SMENCUSNEW.
DATA: END OF ITAB.
DATA: BEGIN OF STACK OCCURS 10,
                 ID(5) TYPE N,
             END OF STACK.
DATA: I TYPE I.
PARAMETERS: TRANS LIKE TSTC-TCODE.

* Get the id of our transaction
SELECT * FROM SMENCUSNEW WHERE REPORT = TRANS AND CUSTOMIZED = 'S'.
       MOVE-CORRESPONDING SMENCUSNEW TO ITAB.
       APPEND ITAB.
ENDSELECT.

* Our transaction is not in smencusnew
IF SY-SUBRC <> 0.
    WRITE: / TRANS COLOR 5.
    SKIP.
    WRITE: / 'Not in the profile generator''s table'.
    EXIT.
ENDIF.

* Get the parent id that links us to the root with the fewest levels
SORT ITAB BY MENU_LEVEL.
READ TABLE ITAB INDEX 1.
STACK = ITAB-OBJECT_ID. APPEND STACK.
STACK = ITAB-PARENT_ID. APPEND STACK.

* Search for the grandparets ...
DO.
    CLEAR ITAB. REFRESH ITAB.
    SELECT * FROM SMENCUSNEW WHERE OBJECT_ID = STACK-ID AND
        CUSTOMIZED = 'S'.
        MOVE-CORRESPONDING SMENCUSNEW TO ITAB.
        APPEND ITAB.
    ENDSELECT.
    SORT ITAB BY MENU_LEVEL.
    READ TABLE ITAB INDEX 1.
    IF ITAB-PARENT_ID = '00001'. EXIT. ENDIF.
    STACK = ITAB-PARENT_ID. APPEND STACK.
ENDDO.

* Display the result
WRITE: / TRANS COLOR 5.HIDE TRANS. CLEAR TRANS.
WRITE: ' <<<< Doubleclick to see the transaction'.
SKIP.
WRITE: /(30) 'Main Menu' COLOR 2.
SORT STACK.
LOOP AT STACK.
   I = I + 3.
   SELECT SINGLE * FROM SMENENTT WHERE SPRAS = 'E' AND OBJECT_ID = STACK.
   WRITE: /I(30) SMENENTT-TEXT COLOR 2.
ENDLOOP.

* Display the transaction when the user doubleclick on trans
AT LINE-SELECTION.
IF NOT TRANS IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE = TRANS.
    CALL TRANSACTION TRANS.
ENDIF.
CLEAR TRANS.
 
< Prev   Next >

Google Search

Statistics

Contribution Activity
Utilities: 38
Tips and Tricks: 334
Sample Code: 166
Total Contributions: 553

Member Activity
Members: 6310 since 2/1/2007!
New: 1 since yesterday!
Visitors: 1184107
We have 2 guests online

Newest Members

Welcome our newest members:

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor