cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Get Sap menu by RFC or Bapi or Programe

KlausWangc
Explorer
0 Kudos
562

Dear all,help me:

    How to obtain the menu and transaction code of Sap based on the login name, including the Favorites created by this account?

   QQ20240910-085510.png

Accepted Solutions (1)

Accepted Solutions (1)

Sandra_Rossi
Active Contributor

By program? (Manually, there's a download for favorites.)

For favorites. search the Web around SMEN_BUFFC or BX_FAVOS_READ_ALL_NODES.

For "SAP Menu", it's the same for all users. The users can also display another menu which is role-based (varies for every user). For "SAP Menu", it's a menu named S000, use STREE_STRUCTURE_READ_N_TOP_LEV. As I don't find answers in the Web, I post the code here:

  DATA structure_id    TYPE ttree-id.
  DATA read_all_levels TYPE hier_types-char1.
  DATA read_n_levels   TYPE hier_types-numc2.
  DATA structure_table TYPE STANDARD TABLE OF hier_iface.

  structure_id = 'S000'.
  read_all_levels = 'X'.
  CALL FUNCTION 'STREE_STRUCTURE_READ_N_TOP_LEV'
    EXPORTING
      structure_id          = structure_id
      read_all_levels       = read_all_levels
      read_n_levels         = read_n_levels
    TABLES
      structure_table       = structure_table.
KlausWangc
Explorer
0 Kudos
Thank you for your help!

Answers (0)