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

Build screen menu dynamically during program flow

Former Member
0 Likes
412

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
371

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

3 REPLIES 3
Read only

Former Member
0 Likes
372

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

Read only

Former Member
0 Likes
371

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.

Read only

former_member787646
Contributor
0 Likes
371

Hi,

Try the following code....

IF SY-UNAME = '<username>'.

SET PF-STATUS '<MENU1>'.

ELSE.

SET PF-STATUS '<MENU2>'.

ENDIF.

Hope it helps you.

Murthy