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

Former Member
0 Likes
533

Hi friends,

I need to display two pushbuttons and two parameters on the selection screen, when I click one push button I have to display one parameter and hide the another parameter,same with the second pushbutton.Please give me some sample code.

sathish.

1 ACCEPTED SOLUTION
Read only

sushant_singh
Participant
0 Likes
510

hi satish,

case sy-ucomm.

when 1.

loop at screen.

if screen-name = 'field1'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

when 2.

loop at screen.

if screen-name = 'field2'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

endcase.

4 REPLIES 4
Read only

Former Member
0 Likes
510

hi satish,

case sy-ucomm.

when 1.

loop at screen.

if screen-name = 'field1'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

when 2.

loop at screen.

if screen-name = 'field2'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

endcase.

hope this helps,

do reward if it helps,

Read only

naimesh_patel
Active Contributor
0 Likes
510

Hello,

Try this code:

DATA: W_COMM LIKE SY-UCOMM.

SELECTION-SCREEN PUSHBUTTON 1(10) P_1 USER-COMMAND PB1.

SELECTION-SCREEN PUSHBUTTON 21(10) P_2 USER-COMMAND PB2.

PARAMETERS: P_f1(10) MODIF ID GP1,

P_f2(10) MODIF ID GP2.

INITIALIZATION.

P_1 = 'But1'.

P_2 = 'but2'.

w_comm = 'PB1'.

AT SELECTION-SCREEN.

W_COMM = SY-UCOMM.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF W_COMM = 'PB1'.

IF SCREEN-GROUP1 = 'GP2'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

IF W_COMM = 'PB2'.

IF SCREEN-GROUP1 = 'GP1'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

regards,

Naimesh

Read only

sushant_singh
Participant
0 Likes
511

hi satish,

case sy-ucomm.

when 1.

loop at screen.

if screen-name = 'field1'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

when 2.

loop at screen.

if screen-name = 'field2'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

endcase.

Read only

sushant_singh
Participant
0 Likes
510

hi satish,

case sy-ucomm.

when 1.

loop at screen.

if screen-name = 'field1'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

when 2.

loop at screen.

if screen-name = 'field2'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

endcase.