04-09-2008 11:53 AM
Hi everbody,
mayby sombody knows how to assign key shortcut (f.e. Ctrl+F) to buttons on menu toolbar in ALV grid?
I have analysed topic and looks not so simple. It is functioning with GUI Status buttons, but in ALV I dont see solution.
Thank you in advance for your help,
best regards
Mirek
04-10-2008 5:03 AM
Hello Miroslaw
I think this is not possible for the following reason.
If you look at the method ADD_FUNCTION of class CL_GUI_TOOLBAR or instance parameter MT_TOOLBAR of class CL_ALV_EVENT_TOOLBAR_SET (event TOOLBAR of cl_gui_alv_grid) you see that in both cases the structure STB_BUTTON is used to describe the new button/function.
This structure has the following fields:
FUNCTION Function Code
ICON Name of an Icon
QUICKINFO Quickinfo for an icon
BUTN_TYPE Toolbar button type
DISABLED Disabled
TEXT Text, 40 Characters Long
CHECKED Printed
From the absence of any field for a shortcut code I conclude that you requirement cannot be implemented.
Regards
Uwe
04-10-2008 8:09 AM
Hi Uwe,
thank you for reponse.
I think exactly so.
It seems to be impossible.
For key shortcuts react only GUI STATUS of ABAP Dynpro (classic). Grid control is in other layer (container). The problem is how to raise inetrnal event in the ALV instance from outside. I dont see any method or way to do this .
If it would be possible, SAP would document this already.
Best regards,
Mirek
06-12-2008 5:13 PM
Hi fellows,
after some time brewing of this question, the solution has been found.
One has to use the method
set_function_code( CHANGING c_ucomm = lv_fc_from_outside )
of ALV instance on which we want fire the event with this fc connected .
F.e. find is %SC.
Note: you must use this value in variable.
Its working perfect.:)
Best Regards,
Mirek