2009 Jan 30 1:11 PM
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.
2009 Jan 30 1:25 PM
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.
2009 Jan 30 1:17 PM
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
2009 Jan 30 1:25 PM
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.
2009 Jan 30 1:51 PM
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
2009 Jan 30 2:54 PM
Thanks a lot to all who provided their valuable inputs. I love SDN.
Regards,
Rajesh.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |