‎2007 Jun 26 10:27 AM
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
‎2007 Jun 26 10:32 AM
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
‎2007 Jun 26 10:33 AM
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
‎2007 Jun 26 10:33 AM
Hi,
At selection-screen.
if sscrfields-ucomm = <b>'CLI1'.</b>
flag = '1'.
elseif sscrfields-ucomm = <b>'CLI2'.</b>
flag = '2'.
endif.
‎2007 Jun 26 10:34 AM
hi,
check this demo report 'demo_sel_screen_pushbutton.'.
reward points if useful,
regards,
seshu.
‎2007 Jun 26 10:35 AM
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.