‎2008 May 14 12:58 AM
Hi forum,
I'm programming with dynpros, and I have to include an Authority Check in order to control access to my application. Well, the auth check setup includes a function codes blocking, i. e., gray-coloured texts and deactivated function for the menu bar elements. My question is, how can I get the function codes in a dynpro? I tried with method if_wb_program~wb_manager->get_status, but it generates an error. May be any execution environment.
Does exist any FM, Method, or table reading in order to get the function codes?
My target is set PF-STATUS, and fill the table g_ti_excl_fcodes:
SET PF-STATUS p_status EXCLUDING g_ti_excl_fcodes.
Thanks in advance,
JORGE ROJAS
‎2008 May 14 4:02 AM
Here you go:
data:
l_is_allowed type sap_bool,
lt_exclude_fcode like rsmpe-func occurs 10,
ls_function_list like rsmpe_funl,
lt_function_list like rsmpe_funl occurs 10.
*
* Read in the functions defined in the PF-STATUS
*
call function 'RS_CUA_GET_STATUS_FUNCTIONS'
exporting
language = sy-langu
program = gc_this_program "set a constant somewhere
status = '0300_UPDATE' "GUI status name
tables
function_list = lt_function_list
exceptions
others = 1.
if not sy-subrc is initial.
exit. "... internal error!
endif.
*
* Then do your exclude logic e.g.
*
loop at lt_function_list into ls_function_list.
perform some_business_rule "your code...
using
ls_function_list-fcode
changing
l_is_allowed. "X or space = sap_bool
if l_is_allowed = gc_is_false. "space
append ls_function_list-fcode to lt_exclude_fcode.
endif.
endloop.
Jonathan
‎2008 May 14 4:02 AM
Here you go:
data:
l_is_allowed type sap_bool,
lt_exclude_fcode like rsmpe-func occurs 10,
ls_function_list like rsmpe_funl,
lt_function_list like rsmpe_funl occurs 10.
*
* Read in the functions defined in the PF-STATUS
*
call function 'RS_CUA_GET_STATUS_FUNCTIONS'
exporting
language = sy-langu
program = gc_this_program "set a constant somewhere
status = '0300_UPDATE' "GUI status name
tables
function_list = lt_function_list
exceptions
others = 1.
if not sy-subrc is initial.
exit. "... internal error!
endif.
*
* Then do your exclude logic e.g.
*
loop at lt_function_list into ls_function_list.
perform some_business_rule "your code...
using
ls_function_list-fcode
changing
l_is_allowed. "X or space = sap_bool
if l_is_allowed = gc_is_false. "space
append ls_function_list-fcode to lt_exclude_fcode.
endif.
endloop.
Jonathan
‎2008 May 14 9:57 PM
Jonathan
Thanks so much for your answer. It was so fast and clear, really.
Thanks a lot, again.
JORGE ROJAS