‎2011 May 03 11:09 AM
Hi All,
I want to submit a report if the user presses any assigned function key when he is on the selection screen of a t-code.
how can i capture the commands of function key on selection screen.
‎2011 May 03 11:57 AM
hi
try below code
TABLES sscrfields.
INITIALIZATION.
PARAMETERS : p_1 TYPE c.
SELECTION-SCREEN : FUNCTION KEY 1.
SSCRFIELDS-FUNCTXT_01 = 'Report'.
SELECTION-SCREEN : FUNCTION KEY 2.
SSCRFIELDS-FUNCTXT_02 = 'Report2'.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'FC01'.
SUBMIT ZXXX1 VIA SELECTION-SCREEN AND RETURN.
ENDIF.
IF sscrfields-ucomm = 'FC01'.
SUBMIT ZXXX2 VIA SELECTION-SCREEN AND RETURN.
ENDIF.
‎2011 May 03 11:57 AM
hi
try below code
TABLES sscrfields.
INITIALIZATION.
PARAMETERS : p_1 TYPE c.
SELECTION-SCREEN : FUNCTION KEY 1.
SSCRFIELDS-FUNCTXT_01 = 'Report'.
SELECTION-SCREEN : FUNCTION KEY 2.
SSCRFIELDS-FUNCTXT_02 = 'Report2'.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'FC01'.
SUBMIT ZXXX1 VIA SELECTION-SCREEN AND RETURN.
ENDIF.
IF sscrfields-ucomm = 'FC01'.
SUBMIT ZXXX2 VIA SELECTION-SCREEN AND RETURN.
ENDIF.
‎2011 May 03 12:28 PM
i want to use function keys like 'F12' or "F07' or 'F05' tp submit a report when i am on any selection,not by making buttons on the application toolbar.
‎2011 May 03 12:43 PM
hi
as u want this functionality on selection screen so when u make a button then SAP by itself give a function key to those buttons like for button1 - Ctrl + F1 , for button2 - Ctrl + F2 ....
and i dont thing u can give like F12 or F7 of ur own but if anyone know how to do then plz reply...
Edited by: mihir6666 on May 3, 2011 1:43 PM
‎2011 May 03 1:33 PM
hi,
Using PF-Status Paint the menu and assign Function key for your buttons
Go to Utilities --> F key Consistency and assign function key
Regards
Rajashiva Ramalingam
‎2011 May 04 11:01 AM
HI i got the answer.
Either we can have Set PF-Status in the event INITIALIZATION or we can use it by using the function module in AT SELECTION-SCREEN OUTPUT and then caputre the command in AT SELECTION-SCREEN and do the respective coding as per requirement
Thnx a lot for ur help