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

Regarding button in selection screen

Former Member
0 Likes
650

Hi all,

A query...

After clicking the button on the screen, when i press the execute button it should give a display saying the corresponding button i clicked....

But its not working out frnds...

tables sscrfields.

data flag.

parameters test.

selection-screen pushbutton /20(10) but1 user-command cli1.

selection-screen pushbutton /20(10) text-020 user-command cli2.

initialization.

but1 = 'Button 1'.

At selection-screen.

if sscrfields-ucomm = 'cli1'.

flag = '1'.

elseif sscrfields-ucomm = 'cli2'.

flag = '2'.

endif.

start-of-selection.

if flag = '1'.

write :/'Button 1 was clicked'.

elseif flag = '2'.

write :/'Button 2 was clicked'.

endif.

Thanking u all.

regards,

suraj

5 REPLIES 5
Read only

Former Member
0 Likes
619

Hello,

The problem is here


TABLES SSCRFIELDS.
DATA FLAG.
PARAMETERS TEST.

SELECTION-SCREEN PUSHBUTTON /20(10) BUT1 USER-COMMAND CLI1.
SELECTION-SCREEN PUSHBUTTON /20(10) TEXT-020 USER-COMMAND CLI2.

INITIALIZATION.
  BUT1 = 'Button 1'.

AT SELECTION-SCREEN.
  IF SSCRFIELDS-UCOMM = 'CLI1'.  " Change to upper case
    FLAG = '1'.
  ELSEIF SSCRFIELDS-UCOMM = 'CLI2'. " Change to upper case

    FLAG = '2'.
  ENDIF.

START-OF-SELECTION.
  IF FLAG = '1'.
    WRITE :/'Button 1 was clicked'.
  ELSEIF FLAG = '2'.
    WRITE :/'Button 2 was clicked'.
  ENDIF.

VAsanth

Read only

Former Member
0 Likes
619

Hi Suraj,

Please try this

At selection-screen.

if sscrfields-ucomm = <b>'CLI1'.</b>

flag = '1'.

elseif sscrfields-ucomm = <b>'CLI2'.</b>

flag = '2'.

endif.

Reward points if useful.

Regards,

Atish

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
619

Hi,

At selection-screen.

if sscrfields-ucomm = <b>'CLI1'.</b>

flag = '1'.

elseif sscrfields-ucomm = <b>'CLI2'.</b>

flag = '2'.

endif.

Read only

Former Member
0 Likes
619

hi,

check this demo report 'demo_sel_screen_pushbutton.'.

reward points if useful,

regards,

seshu.

Read only

Former Member
0 Likes
619

Hi,

<b>CHECK THIS CODE now it's working</b>

data flag.

selection-screen pushbutton /20(10) but1 user-command CLI1.

selection-screen pushbutton /20(10) but2 user-command CLI2.

initialization.

but1 = 'Button 1'.

but2 = 'Button 2'.

At selection-screen.

<b>if sy-ucomm = 'CLI1'.</b>

flag = '1'.

<b>elseif sy-ucomm = 'CLI2'.</b>

flag = '2'.

endif.

start-of-selection.

if flag = '1'.

write :/'Button 1 was clicked'.

elseif flag = '2'.

write :/'Button 2 was clicked'.

endif.

Regards,

Priyanka.