2023 Nov 20 6:46 AM
Hello everyone
How can I assign "CTRL + F" as a shortcut to the "Find" button in "CL_GUI_ALV_GRID".
Thanks for your answers in advance
2023 Nov 22 12:24 AM
'CTRL + F ' was not assigned as a shortcut key in the 'FIND(SEARCH' button in the standard
toolbar of 'CL_GUI_ALV_GRID' and I actually wanted to ask how to assign it.As a solution,I activated
the 'FIND' button in 'GUI-PF-STATUS' and assigned the shortcut 'CTRL + F' .Then in 'PAI' where it was
triggered,I ran the standard '%SC' in the 'SET_FUNCTION_CODE' method of 'CL_GUL_ALV_GRID'.Sorry in advance for the translation. :).
MODULE user_command_0100 INPUT.
IF sy-ucomm ='FIND'.
DATA(fcode)= CONV syucomm('%SC').
go_grid->set_function_code(CHANGING c_ucomm = fcode).
ENDIF.
ENDMODULE.
2023 Nov 20 7:31 AM
CTRL+F is default for "SEARCH" , as far as i know, it can't be used in custom buttons etc.
However, it searches values from your ALV.
2023 Nov 20 8:01 AM
As Ctrl+F is part of standard Dynpro GUI Status, maybe you can define it in the GUI Status and call the method FIND of your ALV Grid when it's pressed?
2023 Nov 20 10:48 PM
Thanks For Your Answers Guys....
Sandra Rossi,as you said,enable 'FIND' button in 'GUI' and then in 'PAI'
DATA(fcode) = CONV syucomm( '%SC' ).
go_grid->set_function_code( c_ucomm = CHANGING fcode).
2023 Nov 21 10:21 AM
hsynylmz32 Thanks for the feedback, it was just a guess from me, could you convert your comment into an answer please? (note that the ABAP code you have posted has currently an invalid syntax, so you should fix it; also maybe clarify a little bit, I don't understand very well how your code intercepts Ctrl+F of the GUI Status, and how you run the method FIND = your solution is completely different from the one I was thinking)
2023 Nov 21 4:18 PM
Hi Sandra Rossi....
'CTRL + F ' was not assigned as a shortcut key in the 'FIND(SEARCH' button in the standard
toolbar of 'CL_GUI_ALV_GRID' and I actually wanted to ask how to assign it.As a solution,I activated
the 'FIND' button in 'GUI-PF-STATUS' and assigned the shortcut 'CTRL + F' .Then in 'PAI' where it was
triggered,I ran the standard '%SC' in the 'SET_FUNCTION_CODE' method of 'CL_GUL_ALV_GRID'.
Sorry in advance for the translation. :).
2023 Nov 21 4:26 PM
Nice, I understand now, thank you for the clarification. Could you convert your comment into an answer please? (or post an answer with same text if you prefer).
2023 Nov 22 12:24 AM
'CTRL + F ' was not assigned as a shortcut key in the 'FIND(SEARCH' button in the standard
toolbar of 'CL_GUI_ALV_GRID' and I actually wanted to ask how to assign it.As a solution,I activated
the 'FIND' button in 'GUI-PF-STATUS' and assigned the shortcut 'CTRL + F' .Then in 'PAI' where it was
triggered,I ran the standard '%SC' in the 'SET_FUNCTION_CODE' method of 'CL_GUL_ALV_GRID'.Sorry in advance for the translation. :).
MODULE user_command_0100 INPUT.
IF sy-ucomm ='FIND'.
DATA(fcode)= CONV syucomm('%SC').
go_grid->set_function_code(CHANGING c_ucomm = fcode).
ENDIF.
ENDMODULE.
2023 Nov 22 7:54 AM
Just adding the code of your original comment (with more context). You may also edit your answer to embed it.
MODULE user_command_0100 INPUT.
IF sy-ucomm = 'FIND'.
DATA(fcode) = CONV syucomm( '%SC' ).
go_grid->set_function_code( CHANGING c_ucomm = fcode).
ENDIF.
ENDMODULE.
2023 Nov 22 7:55 AM