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

Shortcut Key to PushButton

BGarcia
Active Contributor
0 Likes
2,217

Hello Friends,

Can anyone tell me if it is possible to map a shortcut key to a pushbutton on a selection screen? For example, when user presses key F10, then the program will execute the code flow associated to a button on the screen.

If yes, how?

Thanks in advance.

Kind regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,074

Hi

On selection-screen u can assign only 5 your own buttons, the keys of keyboards assigned to them are:

- CTRL+F1

- CTRL+F2

- CTRL+F3

- CTRL+F4

- CTRL+F5

U have to check the ok-code value in the event AT SELECTION-SCREEN, these butto can hav a code FC<XX>:

TABLES SSCRFIELDS.

PARAMETERS: P_BUKRS LIKE T001-BUKRS.

SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
SELECTION-SCREEN FUNCTION KEY 3.
SELECTION-SCREEN FUNCTION KEY 4.
SELECTION-SCREEN FUNCTION KEY 5.

INITIALIZATION.
  MOVE: '@01@ 1' TO SSCRFIELDS-FUNCTXT_01,
        '@02@ 2' TO SSCRFIELDS-FUNCTXT_02,
        '@03@ 3' TO SSCRFIELDS-FUNCTXT_03,
        '@04@ 4' TO SSCRFIELDS-FUNCTXT_04,
        '@05@ 5' TO SSCRFIELDS-FUNCTXT_05.

AT SELECTION-SCREEN.


  CASE SSCRFIELDS-UCOMM.
    WHEN 'FC01'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F1'.
    WHEN 'FC02'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F2'.
    WHEN 'FC03'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F3'.
    WHEN 'FC04'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F4'.
    WHEN 'FC05'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F5'.
  ENDCASE.

Max

Hello Friends,

Can anyone tell me if it is possible to map a shortcut key to a pushbutton on a selection screen? For example, when user presses key F10, then the program will execute the code flow associated to a button on the screen.

If yes, how?

Thanks in advance.

Kind regards.

3 REPLIES 3
Read only

Former Member
0 Likes
1,075

Hi

On selection-screen u can assign only 5 your own buttons, the keys of keyboards assigned to them are:

- CTRL+F1

- CTRL+F2

- CTRL+F3

- CTRL+F4

- CTRL+F5

U have to check the ok-code value in the event AT SELECTION-SCREEN, these butto can hav a code FC<XX>:

TABLES SSCRFIELDS.

PARAMETERS: P_BUKRS LIKE T001-BUKRS.

SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
SELECTION-SCREEN FUNCTION KEY 3.
SELECTION-SCREEN FUNCTION KEY 4.
SELECTION-SCREEN FUNCTION KEY 5.

INITIALIZATION.
  MOVE: '@01@ 1' TO SSCRFIELDS-FUNCTXT_01,
        '@02@ 2' TO SSCRFIELDS-FUNCTXT_02,
        '@03@ 3' TO SSCRFIELDS-FUNCTXT_03,
        '@04@ 4' TO SSCRFIELDS-FUNCTXT_04,
        '@05@ 5' TO SSCRFIELDS-FUNCTXT_05.

AT SELECTION-SCREEN.


  CASE SSCRFIELDS-UCOMM.
    WHEN 'FC01'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F1'.
    WHEN 'FC02'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F2'.
    WHEN 'FC03'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F3'.
    WHEN 'FC04'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F4'.
    WHEN 'FC05'. MESSAGE I208(00) WITH 'You have pressed KEY CTRL+F5'.
  ENDCASE.

Max

Read only

Former Member
0 Likes
1,074

Is it module pool program ? then you can do -> click on GUI at PBO -> now you will be at menu painter(SE41 Screen)-> below see the Function code -> here add your push button user command.

Thanks

Seshu

Read only

BGarcia
Active Contributor
0 Likes
1,074

Thanks for the help