02-13-2014 12:51 PM
Hi all,
I want to divert the gui status standard logic when I click in any button on the ALV screen and CALL THE DEFAULT LOGIC BACK to keep the logic flow.
The real situation is that we have the save layout button and I want to control the access for it. So I want the logic to pass trough my code before goes to the default logic to check if the user has authorization to change the global layout. If it have authorization to save so the default logic would be called.
Is it possible?
Note: The sap gui were copied from STANDARD_FULLSCREEN in Function group SLVC_FULLSCREEN
Thanks,
Andrea
02-13-2014 1:18 PM
Hi Andrea
Can you do it like before displaying the ALV check your logic if its their then button is displayed else not. If it suits you can exclude the ok code for the layout in your set pf status command
Nabheet
02-13-2014 1:55 PM
It need to be dinamic. In some cases it need to allow saving and some cases not allow depending on data changed after REUSE_ALV logic.
In this case only to Global layout. So remove the button is not a option because the user can save user specific layout.
If I create a new OK code I will divert it, all logic. I just need to divert to check if it's a global layout and then, if not, keep the standard logic.
Thanks,
Andrea
02-13-2014 2:09 PM
Hi,
pass parameter
i_callback_user_command = 'USER_COMMAND_USER' into FM REUSE_ALV*
and write down form and put breakpoint in it :
form user_command_user using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when 'XXX.
endcase.
endform.
may be it will be helpful
02-13-2014 2:12 PM
02-13-2014 2:30 PM
Andrea, if it will help, I recomend you to use object ALV with class cl_salv_table
Look at example program SALV_TEST_FUNCTIONS
event handle class
CLASS lcl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS:
on_user_command FOR EVENT added_function OF cl_salv_events
IMPORTING e_salv_function,
on_before_user_command FOR EVENT before_salv_function OF cl_salv_events
IMPORTING e_salv_function,
on_after_user_command FOR EVENT after_salv_function OF cl_salv_events
IMPORTING e_salv_function.
ENDCLASS. "lcl_handle_events DEFINITION
I think - event before_salv_function will help you !
02-13-2014 3:19 PM
Hi,
I feel, you need to change the design of the program. Before displaying ALV, you should do the authorization check and display only the button for user-specific layout or both. We can add dropdown buttons in the toolbar for layout and then add function to it based on the authorization.
Regards,
DPM