Application Development 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: 

PUSHBUTTON and AT SELECTION-SCREEN

Former Member
0 Kudos

Hi, I don't understand why I'm not being able to catch the user command in the example below. I tried in the CASE statement sscrfields-ucomm, sscrfields, sy-comm, but none of them work. Is the problem related with displaying a message ? Or am I indeed misunderstanding the use of the USER-COMMAND assigned to the PUSHBUTTON I created ? All I want is to be able to perform any action in the AT SELECTION-SCREEN event, when the button is pushed.

SELECTION-SCREEN BEGIN OF LINE.
  SELECTION-SCREEN PUSHBUTTON 4(10) but1 USER-COMMAND c1.
SELECTION-SCREEN END OF LINE.

INITIALIZATION.
  but1 = 'BUTTON 1'.
 
AT SELECTION-SCREEN.
  CASE sy-ucomm.
*  CASE sscrfields-ucomm.
*  CASE sscrfields.
    WHEN 'c1'.
      MESSAGE 'You clicked me' TYPE 'I'.
  ENDCASE.

Thanks !

Avraham

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Give C1 in caps

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 4(10) but1 USER-COMMAND c1.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

but1 = 'BUTTON 1'.

AT SELECTION-SCREEN.

CASE sy-ucomm.

  • CASE sscrfields-ucomm.

  • CASE sscrfields.

WHEN 'C1'.

MESSAGE 'You clicked me' TYPE 'I'.

ENDCASE.

Cheers

Kothand

4 REPLIES 4

Former Member
0 Kudos

Hi,

SELECTION-SCREEN PUSHBUTTON 4(10) but1 USER-COMMAND C1.

change the user command as capital.

JozsefSzikszai
Active Contributor
0 Kudos

hi,

change it to capitals:

WHEN 'c1'. ==> WHEN 'C1'.

hope this helps

ec

Former Member
0 Kudos

Hi,

Give C1 in caps

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 4(10) but1 USER-COMMAND c1.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

but1 = 'BUTTON 1'.

AT SELECTION-SCREEN.

CASE sy-ucomm.

  • CASE sscrfields-ucomm.

  • CASE sscrfields.

WHEN 'C1'.

MESSAGE 'You clicked me' TYPE 'I'.

ENDCASE.

Cheers

Kothand

Former Member
0 Kudos

Irch... !!!

Thanks guys !