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

Making buttons in application toolbar dynamic....

Former Member
0 Likes
1,505

Hello,

I have a application tool bar with 8 icon buttons defined. Now I have a custom configuration table where I check what buttons in application toolbar should be seen so that user can select which button he wants to see and which not anytime he wishes.

My question is how can I make buttons in application toolbar dynamic ?

Please guide.

Regards,

Rajesh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,037

This is sample logic, but you can adapt it to you needs


DATA: excl_tab   TYPE sy-ucomm OCCURS 0 WITH HEADER LINE.

  AUTHORITY-CHECK OBJECT 'ZREO'  ID 'ACTVT' FIELD c_print.
  IF sy-subrc NE 0.
    APPEND 'PRIN' TO excl_tab.
  ENDIF.

  IF ok_0010 = 'DISP' OR ok_0010 = 'DELE'.
    APPEND 'SAVE' TO excl_tab.
  ENDIF.

  IF ok_0010 <> 'DELE'.
    APPEND 'DELE' TO excl_tab.
  ENDIF.

  SET PF-STATUS 'STAT_100' EXCLUDING excl_tab.

This is sample logic, but you can adapt it to you needs


DATA: excl_tab   TYPE sy-ucomm OCCURS 0 WITH HEADER LINE.

  AUTHORITY-CHECK OBJECT 'ZREO'  ID 'ACTVT' FIELD c_print.
  IF sy-subrc NE 0.
    APPEND 'PRIN' TO excl_tab.
  ENDIF.

  IF ok_0010 = 'DISP' OR ok_0010 = 'DELE'.
    APPEND 'SAVE' TO excl_tab.
  ENDIF.

  IF ok_0010 <> 'DELE'.
    APPEND 'DELE' TO excl_tab.
  ENDIF.

  SET PF-STATUS 'STAT_100' EXCLUDING excl_tab.

4 REPLIES 4
Read only

Former Member
0 Likes
1,037

Hi,

I think you need to define diff PF status's depending on the conbination of entries in your custom table for 8 buttons and use the SET PF-STATUS <pfnn> by reading the entry from custom table.

With Regards,

Dwaraka.S

Edited by: Dwarakanath Sankarayogi on Jan 30, 2009 2:17 PM

Read only

Former Member
0 Likes
1,038

This is sample logic, but you can adapt it to you needs


DATA: excl_tab   TYPE sy-ucomm OCCURS 0 WITH HEADER LINE.

  AUTHORITY-CHECK OBJECT 'ZREO'  ID 'ACTVT' FIELD c_print.
  IF sy-subrc NE 0.
    APPEND 'PRIN' TO excl_tab.
  ENDIF.

  IF ok_0010 = 'DISP' OR ok_0010 = 'DELE'.
    APPEND 'SAVE' TO excl_tab.
  ENDIF.

  IF ok_0010 <> 'DELE'.
    APPEND 'DELE' TO excl_tab.
  ENDIF.

  SET PF-STATUS 'STAT_100' EXCLUDING excl_tab.

Read only

MarcinPciak
Active Contributor
0 Likes
1,037

I suggest you to activate all possible buttons, populate your excluding table with all of them removing those which are to be displayed. Then set GUI status with this exluding table. Similar logic to Paul''s.

See some standard statuses like STANDARD_FULLSCREEN in program SAPLSLVC_FULLSCREEN. All the buttons are active there so you can copy it to your program.

Regards

Marcin

Read only

0 Likes
1,037

Thanks a lot to all who provided their valuable inputs. I love SDN.

Regards,

Rajesh.