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

PUSHBUTTON and AT SELECTION-SCREEN

Former Member
0 Likes
809

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
Read only

Former Member
0 Likes
706

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
Read only

Former Member
0 Likes
706

Hi,

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

change the user command as capital.

Read only

JozsefSzikszai
Active Contributor
0 Likes
706

hi,

change it to capitals:

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

hope this helps

ec

Read only

Former Member
0 Likes
707

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

Read only

Former Member
0 Likes
706

Irch... !!!

Thanks guys !