‎2008 Jul 07 12:06 PM
Hi there.
I've got such situation that I have to determine menu bar apperance according user priveleges.
So for example one user will see on the menu bar:
ITEM1
|____subitem1
|____subitem2
|____subitem3
Whilst other user would see :
ITEM1
|____subitem1
|____subitem3
Do You know some way to determine menu structure in ABAP code? Greetings. P.
‎2008 Jul 07 12:13 PM
Hi,
Create 2 pf-statuses with your required menu items and call the appropriate one based on your condition.
IF <cond1>.
Set pf-status 'STATUS1'.
ELSE.
SET PF-STATUS 'STATUS2'.
ENDIF.
Rgds,
Bujji
‎2008 Jul 07 12:13 PM
Hi,
Create 2 pf-statuses with your required menu items and call the appropriate one based on your condition.
IF <cond1>.
Set pf-status 'STATUS1'.
ELSE.
SET PF-STATUS 'STATUS2'.
ENDIF.
Rgds,
Bujji
‎2008 Jul 07 12:17 PM
hi,
while setting the menu use
excl_tab is an internal table should contain the function codes of the buttons which you want to disable for that particular user.
set pf-status 'MENU' excluding excl_tab.
see example below.
DATA fcode TYPE TABLE OF sy-ucomm.
...
MODULE status_0100 OUTPUT.
APPEND 'CHANGE' TO fcode.
APPEND 'SAVE' TO fcode.
SET PF-STATUS 'STATUS_0100' EXCLUDING fcode.
ENDMODULE.
rgds,
bharat.
‎2008 Jul 07 12:19 PM
Hi,
Try the following code....
IF SY-UNAME = '<username>'.
SET PF-STATUS '<MENU1>'.
ELSE.
SET PF-STATUS '<MENU2>'.
ENDIF.
Hope it helps you.
Murthy