08-10-2004 3:40 PM
Hi,
I want to use function keys in the ALV coming with SAP 4.7 (Enterprise).
In SAP 4.5 I had defined a new PFKEY STATUS and all available function keys had been visible by a right mouseclick in the grid.
And now I don't know what to do.
Any hints?
Thanks,
Dieter
08-11-2004 5:53 AM
By function keys if you mean F1, F2... on the keyboard, I am not really aware how to do that but if you need to just put your own buttons in ALV grid , there is a class CL_ALV_EVENT_TOOLBAR_SET available which would allow you to put buttons in toolbar.
PF-Status as far as I know can be still used with ALV in SAP 4.7 .
In 4.5 did you use function modules to show ALV grid or did you use classes to show an ALV grid ?
Let me know if this was helpful.
Subramanian
08-11-2004 9:30 AM
Hi,
have a look for example at the Report RSEIDOC2.
You have global bottons for e.g. refresh and to these a function key is defined n the normal way by set-pf-status 'xxxx' and assignment of the pf-key in the menu painter.
I know how to define buttons in the OO-ALV - as you wrote - via class CL_ALV_EVENT_TOOLBAR_SET:
DATA: ls_toolbar TYPE stb_button.
MOVE 'IDOC' TO ls_toolbar-function.
MOVE icon_idoc TO ls_toolbar-icon.
MOVE text-001 TO ls_toolbar-quickinfo. "IDoc-Anzeige
MOVE text-002 TO ls_toolbar-text. "IDoc
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
where e_object is of type CL_ALV_EVENT_TOOLBAR_SET.
But I found no way to assing a function key to the command 'IDOC'.
Hope this makes it more understandable what I want.
Thanks,
Dieter
08-13-2004 9:19 AM
I think it is impossible to bind function keys directly to ALV grid, because there's no fkey-press event within ABAP objects context. If there was some kind of dictonary class with such event, it would be easy to capture it by event method. But to my knowledge, there isn't one.
You can workaround this by defining a method FKEY_PRESS (possibly in inheried ALV grid) which would be called from "AT PFn" in main prog. From this method you can raise event USER_COMMAND of ALV grid or whatever.
Kind regards,
Igor Barbaric
08-13-2004 10:43 AM
Hello Dieter,
Transaction SE83 (Reuse Library) contains some samples, e.g
* ALV Grid Control ( BCALV_GRID_05 .. 8 )
* ALV Tree Context Menu ( BCALV_TREE_03 )
* ALV Tree Menu Bar ( BCALV_TREE_04 )
Kind Regards
Klaus
PS: for context menus you may use CL_CtMenu to access the definition of a old fashioned Gui-Status.