Application Development 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: 

Function to Get Menu path

Former Member
0 Kudos

Hi,

Is there any function in abap to get a menu path

(File->open)in a particular screen,given the fcode.

thanx

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Not that I'm aware of. You could try building your own function module reading the specific db tables which hold this data.

Regards,

Rich Heilman

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Kaushik!

Not directly - and I never found a transaction, where only one menue-path exists, there were always several hits.

But maybe you want to put parts of the following coding into a own FM:

TEXT_UPPER_CASE = TEXT.
TRANSLATE TEXT_UPPER_CASE TO UPPER CASE.

select * from smensapnew into table i_smensapnew.
select * from smensapt into table i_smensapt where spras = sy-langu.

DESCRIBE TABLE I_SMENSAPNEW LINES LIN.
IF LIN = 0.
  MESSAGE S265(SF).
ENDIF.
SORT I_SMENSAPT BY OBJECT_ID.
SORT I_SMENSAPNEW BY OBJECT_ID.

LOOP AT I_SMENSAPNEW.
  CLEAR SWITCH.
  IF I_SMENSAPNEW-REPORT = TEXT
                               OR I_SMENSAPNEW-REPORT = TEXT_UPPER_CASE.
    SWITCH = 'X'.
  ENDIF.
  READ TABLE I_SMENSAPT WITH KEY OBJECT_ID = I_SMENSAPNEW-OBJECT_ID
                                          BINARY SEARCH.
  IF SY-SUBRC NE 0.
    I_SMENSAPT-TEXT = '???'.
  ENDIF.
  SEARCH I_SMENSAPT-TEXT FOR TEXT.
  IF SY-SUBRC = 0.
    SWITCH = 'X'.
  ENDIF.

  IF SWITCH = ' '.  CONTINUE. EXIT.  ENDIF.

  READ TABLE I_SMENSAPT WITH KEY OBJECT_ID = I_SMENSAPNEW-OBJECT_ID
                                          BINARY SEARCH.
  IF SY-SUBRC NE 0.
    I_SMENSAPT-TEXT = '???'.
  ENDIF.
  WRITE: /  TEXT-015, AT 20 I_SMENSAPNEW-REPORT(20),
                            AT 40 I_SMENSAPT-TEXT(40).
  FORMAT INTENSIFIED OFF.
  DO.
    READ TABLE I_SMENSAPNEW WITH KEY OBJECT_ID = I_SMENSAPNEW-PARENT_ID
                                                          BINARY SEARCH.
    IF SY-SUBRC NE 0. EXIT. ENDIF.
    IF SY-SUBRC EQ 0.
      READ TABLE I_SMENSAPT WITH KEY OBJECT_ID = I_SMENSAPNEW-OBJECT_ID
                                                          BINARY SEARCH.
    ELSE.
      I_SMENSAPT-TEXT = '???'.
    ENDIF.
    IF I_SMENSAPNEW-REPORTTYPE = SPACE.
      CLEAR I_SMENSAPNEW-REPORT.
    ENDIF.
    WRITE: / TEXT-016, AT 20 I_SMENSAPNEW-REPORT(20),
                                  AT 40 I_SMENSAPT-TEXT(40).
  ENDDO.
  FORMAT INTENSIFIED ON.
  ULINE.
ENDLOOP.

Regards,

Christian

Former Member
0 Kudos

Hi kaushik,

try this out.

The function CACS_APPL_GET_SET must be called to determine the current application.

If you want to check several InfoSets in a single step, got to the initial screen of the InfoSets component, select the InfoSets that you want to check, and choose the menu path Goto -> More Functions -> Check and Generate.

Hope this helps u,

Regards,

Nagarajan.

Former Member
0 Kudos

You can use transactions...

search_sap_menu

search_user_menu

This will show the menu access sequence for the transaction.

0 Kudos

Hi,

Actually,For any given abap screen with a pftstatus,by

mentioning the function code,i need to get the menupath.

thanx

0 Kudos

PF-STATUS for a particular screen of a program is a runtime attribute. You will be able to assign some pf-status, enable or disable some function keys during runtime. I don't think you can get that information anywhere. Try these function modules: RS_CUA_ACTIVE_FUNCTION_DIALOG

RS_CUA_GET_STATUS_FUNCTIONS

RS_CUA_GET_FUNCTIONS

Srinivas

0 Kudos

Hi Kaushik!

Are you mixing up function code and transaction code?

In status of screen function codes are defined - but they are not linked to a menu (EXIT, BACK, CANC,...).

Transaction codes can be part of several menues (MM01, WB01, ...), but seldem they are part of screen status.

What's your need?

Regards,

Christian