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

Selection Screen design..

Former Member
0 Likes
1,355

Hi,

On the selection screen, I have 2 pushbuttons and 4 radio buttons. The requirement is, when I run the program, initially none of the radio button should be appeared on selection screen. Only two pushbuttons should be on the screen. Only if I click the first pushbutton, then first and second radio button should appear alongwith both bushbuttons. same way when I click the other pushbutton, the remaininng two radio buttons should come.

Pl help

Thanks,

Hardik

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,324

just try this code

TABLES : SSCRFIELDS.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.

PARAMETERS : R1 RADIOBUTTON GROUP RB1 DEFAULT 'X',

R2 RADIOBUTTON GROUP RB1,

R3 RADIOBUTTON GROUP RB1,

R4 RADIOBUTTON GROUP RB1.

SELECTION-SCREEN PUSHBUTTON /10(20) FRST USER-COMMAND FRST.

SELECTION-SCREEN PUSHBUTTON /10(20) SCND USER-COMMAND SCND.

SELECTION-SCREEN END OF BLOCK B1.

DATA : ACTIVE1 VALUE '1',

ACTIVE2 VALUE '1'.

initialization.

move 'frst' to frst.

move 'scnd' to scnd.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'R1' OR SCREEN-NAME = 'R2' .

SCREEN-INVISIBLE = ACTIVE1.

MODIFY SCREEN.

ENDIF.

IF SCREEN-NAME = 'R3' OR SCREEN-NAME = 'R4' .

SCREEN-INVISIBLE = ACTIVE2.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN.

CASE SSCRFIELDS-UCOMM.

WHEN 'FRST'.

ACTIVE1 = '0'.

ACTIVE2 = '1'.

WHEN 'SCND'.

ACTIVE2 = '0'.

ACTIVE1 = '1'.

ENDCASE.

regards

shiba dutta

14 REPLIES 14
Read only

Former Member
0 Likes
1,324

hai

in selection screen, there is syntex for it

while designing radiobutton u set modif id for it,

PARAMETERS: r1 RADIOBUTTON GROUP rad1 modif id 'SC1',

r2 RADIOBUTTON GROUP rad1 DEFAULT 'X' modif id 'SC1',

r3 RADIOBUTTON GROUP rad1 modif id 'SC1',

s1 RADIOBUTTON GROUP rad2 modif id 'SC2',

s2 RADIOBUTTON GROUP rad2 modif id 'SC2',

s3 RADIOBUTTON GROUP rad2 DEFAULT 'X' modif id 'SC2'.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'SC1'.

screen-intensified = '1'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

IF screen-group1 = 'SC2'.

screen-intensified = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

use this coding its very useful.

Read only

Former Member
0 Likes
1,324

Hi,

While designing the Selection Screen,put the radio buttons into two groups using MODIF ID keyword at the end of the statement.

After that,there is one event called

AT SELECTION SCREEN OUPUT.

here you loop at the screen and can the active the required radio buttions depending on the push button pressed.

Regards.

Balaji Reddy G

****Reward if the answers are helpful

Read only

Former Member
0 Likes
1,324

Hi,

U can achieve this with the help of 'AT SELECTION-SCREEN OUTPUT' event.

First you have to declare 'MODIF ID' along with your radio button declaration.

Here for the first two radio buttons one modif id say ABC and for the other two you have to give different modif id say DEF.

Then in AT SELECTION-SCREEN OUTPUT event u have to write code something similer to this

CASE SY-UCOMM.

WHEN 'ABCD'. " push button 1 fcode

Loop At Screen.

IF screen-group1 = 'ABC'.

screen-active = 1.

ELSE.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

When 'EFGH' . "Push button 2 fcode

Loop At Screen.

IF screen-group1 = 'DEF'.

screen-active = 1.

ELSE.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDCASE.

Read only

0 Likes
1,324

Hi Sreenivasa,

I have already tried this. bt SY-UCOMM does nt hold any value under AT SELECTION-SCREEN OUTPUT.

so button-click will not be carried to next AT SELECTION-SCREEN OUTPUT .

Any other possiblity.

Thanks,

Hardik

Read only

Former Member
0 Likes
1,324

hi .

modify screen will work..but one radiobutton from a grp shud atleast be visible at one time..so u can not have all the four radiobuttons invisible initially..one shud be visible automatically..wht u can do is u can have checkboxes instead of the radiobuttons tht will run fine ..

hope u got my point

amit

Read only

0 Likes
1,324

Amit,

Its a requirement, so I cant change it to checkboxes. And Its possible to make all 4 invisible by modifying screen.

Bt I m nt able to carry the pushbutton click from at selection screen to next at selection-screen output.

any suggestion.

Regards,

Hardik

Read only

0 Likes
1,324

TABLES : SSCRFIELDS.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN PUSHBUTTON /10(20) FRST USER-COMMAND FRST.

SELECTION-SCREEN PUSHBUTTON /10(20) SCND USER-COMMAND SCND.

PARAMETERS : R1 RADIOBUTTON GROUP RB1 DEFAULT 'X',

R2 RADIOBUTTON GROUP RB1,

R3 RADIOBUTTON GROUP RB2 DEFAULT 'X',

R4 RADIOBUTTON GROUP RB2.

SELECTION-SCREEN END OF BLOCK B1.

INITIALIZATION.

LOOP AT SCREEN.

IF SCREEN-NAME = 'R1' OR SCREEN-NAME = 'R2' .

SCREEN-INVISIBLE = ACTIVE1.

MODIFY SCREEN.

ENDIF.

IF SCREEN-NAME = 'R3' OR SCREEN-NAME = 'R4' .

SCREEN-INVISIBLE = ACTIVE2.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN.

CASE SSCRFIELDS-UCOMM.

WHEN 'FRST'.

ACTIVE1 = '0'.

ACTIVE2 = '1'.

WHEN 'SCND'.

ACTIVE2 = '0'.

ACTIVE1 = '1'.

ENDCASE.

Read only

Former Member
0 Likes
1,324

hi ,

try this

TABLES sscrfields.

SELECTION-SCREEN:

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 12(30) but2 USER-COMMAND cli2,

END OF SCREEN 500.

parameters: r1 RADIOBUTTON GROUP g1,

r2 RADIOBUTTON GROUP g1,

r3 RADIOBUTTON GROUP g2,

r4 RADIOBUTTON GROUP g2.

data : Flag type i value 0.

at selection-screen output.

if flag = 0.

loop at screen.

if screen-name = 'r1' or screen-name = 'r2' or screen-name = 'r3' or screen-name = 'r4' .

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endloop.

flag = 1.

endif.

CASE sscrfields.

WHEN 'CLI1'.

loop at screen.

if screen-name = 'r1' or screen-name = 'r2' .

screen-invisible = '0'.

screen-active = '1'.

modify screen.

endif.

if screen-name = 'r3' or screen-name = 'r4' .

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endloop.

WHEN 'CLI2'.

loop at screen.

if screen-name = 'r3' or screen-name = 'r4' .

screen-invisible = '0'.

screen-active = '1'.

modify screen.

endif.

if screen-name = 'r1' or screen-name = 'r2' .

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endloop.

endcase.

Read only

Former Member
0 Likes
1,325

just try this code

TABLES : SSCRFIELDS.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.

PARAMETERS : R1 RADIOBUTTON GROUP RB1 DEFAULT 'X',

R2 RADIOBUTTON GROUP RB1,

R3 RADIOBUTTON GROUP RB1,

R4 RADIOBUTTON GROUP RB1.

SELECTION-SCREEN PUSHBUTTON /10(20) FRST USER-COMMAND FRST.

SELECTION-SCREEN PUSHBUTTON /10(20) SCND USER-COMMAND SCND.

SELECTION-SCREEN END OF BLOCK B1.

DATA : ACTIVE1 VALUE '1',

ACTIVE2 VALUE '1'.

initialization.

move 'frst' to frst.

move 'scnd' to scnd.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'R1' OR SCREEN-NAME = 'R2' .

SCREEN-INVISIBLE = ACTIVE1.

MODIFY SCREEN.

ENDIF.

IF SCREEN-NAME = 'R3' OR SCREEN-NAME = 'R4' .

SCREEN-INVISIBLE = ACTIVE2.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN.

CASE SSCRFIELDS-UCOMM.

WHEN 'FRST'.

ACTIVE1 = '0'.

ACTIVE2 = '1'.

WHEN 'SCND'.

ACTIVE2 = '0'.

ACTIVE1 = '1'.

ENDCASE.

regards

shiba dutta

Read only

0 Likes
1,324

slight modification to shiba's code, u have to declare Mara in the tables statement -

TABLES : SSCRFIELDS,mara.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.

PARAMETERS : R1 RADIOBUTTON GROUP RB1 DEFAULT 'X',

R2 RADIOBUTTON GROUP RB1,

R3 RADIOBUTTON GROUP RB1,

R4 RADIOBUTTON GROUP RB1.

SELECTION-SCREEN PUSHBUTTON /10(20) FRST USER-COMMAND FRST.

SELECTION-SCREEN PUSHBUTTON /10(20) SCND USER-COMMAND SCND.

SELECTION-SCREEN END OF BLOCK B1.

DATA : ACTIVE1 VALUE '1',

ACTIVE2 VALUE '1'.

initialization.

move 'frst' to frst.

move 'scnd' to scnd.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'R1' OR SCREEN-NAME = 'R2' .

SCREEN-INVISIBLE = ACTIVE1.

MODIFY SCREEN.

ENDIF.

IF SCREEN-NAME = 'R3' OR SCREEN-NAME = 'R4' .

SCREEN-INVISIBLE = ACTIVE2.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN.

CASE SSCRFIELDS-UCOMM.

WHEN 'FRST'.

ACTIVE1 = '0'.

ACTIVE2 = '1'.

WHEN 'SCND'.

ACTIVE2 = '0'.

ACTIVE1 = '1'.

ENDCASE.

Read only

0 Likes
1,324

Thx Shiba

It worked. Rewarded

Regards,

Hardik

Read only

Former Member
0 Likes
1,324

still not solved?

Read only

Former Member
0 Likes
1,324

hi ,

try this

TABLES sscrfields.

SELECTION-SCREEN:

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 12(30) but2 USER-COMMAND cli2,

END OF SCREEN 500.

parameters: r1 RADIOBUTTON GROUP g1,

r2 RADIOBUTTON GROUP g1,

r3 RADIOBUTTON GROUP g2,

r4 RADIOBUTTON GROUP g2.

data : Flag type i value 0,

click(5) type c.

<b>at selection-screen output.</b>

if flag = 0.

loop at screen.

if screen-name = 'r1' or screen-name = 'r2' or screen-name = 'r3' or screen-name = 'r4' .

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endloop.

flag = 1.

endif.

CASE CLICK.

WHEN 'CLI1'.

loop at screen.

if screen-name = 'r1' or screen-name = 'r2' .

screen-invisible = '0'.

screen-active = '1'.

modify screen.

endif.

if screen-name = 'r3' or screen-name = 'r4' .

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endloop.

WHEN 'CLI2'.

loop at screen.

if screen-name = 'r3' or screen-name = 'r4' .

screen-invisible = '0'.

screen-active = '1'.

modify screen.

endif.

if screen-name = 'r1' or screen-name = 'r2' .

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endloop.

endcase.

<b>at slection-screen.</b>

CASE sscrfields.

WHEN 'CLI1'.

click = 'CLI1'.

WHEN 'CLI2'.

click = 'CLI2'.

endcase.

Read only

Former Member
0 Likes
1,324

hi,

try with this following code.

tables sscrfields.

data: a type c value 'X'.

data: b type c value 'X'.

selection-screen begin of block b .

selection-screen PUSHBUTTON 12(15) but1 USER-COMMAND cli1.

selection-screen skip.

selection-screen PUSHBUTTON 12(15) but2 USER-COMMAND cli2.

selection-screen skip.

parameters: r1 radiobutton group radi modif id g1 ,

r2 radiobutton group radi modif id g1.

selection-screen skip.

parameters: r3 radiobutton group rad modif id g2,

r4 radiobutton group rad modif id g2.

selection-screen end of block b.

initialization.

but1 = 'PUSHBUTTON1'.

but2 = 'PUSHBUTTON2'.

at selection-screen output.

loop at screen.

if screen-group1 = 'G1'.

if a = 'X'.

screen-active = 0.

modify screen.

endif.

endif.

endloop.

loop at screen.

if screen-group1 = 'G2'.

if b = 'X'.

screen-active = 0.

modify screen.

endif.

endif.

endloop.

at selection-screen.

case sscrfields-ucomm.

when 'CLI1'.

clear a.

when 'CLI2'.

clear b.

endcase.

hope it helpful.

if it helpful reward me.