Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

using FUnction keys on selection screen

Former Member
0 Likes
8,567

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,108

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.

5 REPLIES 5
Read only

Former Member
0 Likes
3,109

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.

Read only

0 Likes
3,108

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.

Read only

0 Likes
3,108

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

Read only

Former Member
0 Likes
3,108

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

Read only

0 Likes
3,108

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