Application Development 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: 

Radio button in module pool program

Former Member
0 Kudos

Hi Everyone,

I have 5 radio buttons out of which 2 are grouped as one group and the other 3 are grouped seperately.

When I select a radio button in 1st group then an i/o field becomes invisible.

Also when I select a radio button from the other group then another i/o field gets invisible.

Every thing is ok but when I am selecting the radio button from 2nd group the i/o field which got invisible when the radio button from 1st group is selected is again getting visible.

So please help me to salve my problem.

Thanks in advance,

Pavan.

1 ACCEPTED SOLUTION

former_member585865
Contributor
0 Kudos

Hi Pavan,

Just Check below code,

LOOP AT SCREEN.

IF p_r1 = 'X'.

IF screen-group1 = 'B'.

screen-active = 0.

ENDIF.

ELSEIF p_r2 = 'X'.

IF screen-group1 = 'A'.

screen-active = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

Just Check you have given Modify Screen.

6 REPLIES 6

former_member585865
Contributor
0 Kudos

Hi Pavan,

Just Check below code,

LOOP AT SCREEN.

IF p_r1 = 'X'.

IF screen-group1 = 'B'.

screen-active = 0.

ENDIF.

ELSEIF p_r2 = 'X'.

IF screen-group1 = 'A'.

screen-active = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

Just Check you have given Modify Screen.

0 Kudos

Hi Suresh,

This is my actual code. Could you suggest me the changes that I need to do in this.

CASE SY-UCOMM.

WHEN 'F_AT'.

IF R1 = 'X'.

Perform screen_opt_grp USING 'G1' '0' '1'.

ELSE.

Perform screen_opt_grp USING 'G1' '1' '0'.

ENDIF.

WHEN 'F_MOP'.

IF R3 = 'X'.

Perform screen_opt_grp2 USING 'G2' '0' '1'.

ELSEIF R5 = 'X'.

Perform Screen_opt_name1 USING 'field1' '0' '1'.

ELSEIF R4 = 'X'.

Perform Screen_opt_name2 USING 'field2' '0' '1'.

ENDIF.

ENDCASE.

Thanks,

Pavan.

0 Kudos

Hi Pavan,

ASE SY-UCOMM.

WHEN 'F_AT'.

IF R1 = 'X'.

Perform screen_opt_grp USING 'G1' '0' '1'.

ELSE.----


> Try giving r2 = 'X' in the elseif condition

Perform screen_opt_grp USING 'G1' '1' '0'.

ENDIF.

WHEN 'F_MOP'.

IF R3 = 'X'.

Perform screen_opt_grp2 USING 'G2' '0' '1'.

ELSEIF R5 = 'X'.

Perform Screen_opt_name1 USING 'field1' '0' '1'.

ELSEIF R4 = 'X'.

Perform Screen_opt_name2 USING 'field2' '0' '1'.

ENDIF.

ENDCASE.

0 Kudos

Hi,

I think the problem is that when you are selecting the radio button from the other group the PBO is called again and its getting refreshed.

If the code you have written in the perform is correct then write the perform statement written for F_AT

again in F_MOP. I have faced a similar problem before and got it solved. Hope it even works for you.

CASE SY-UCOMM.

WHEN 'F_AT'.

IF R1 = 'X'.

Perform screen_opt_grp USING 'G1' '0' '1'.

ELSE.

Perform screen_opt_grp USING 'G1' '1' '0'.

ENDIF.

WHEN 'F_MOP'.

IF R1 = 'X'.

Perform screen_opt_grp USING 'G1' '0' '1'.

ELSE.

Perform screen_opt_grp USING 'G1' '1' '0'.

ENDIF.

IF R3 = 'X'.

Perform screen_opt_grp2 USING 'G2' '0' '1'.

ELSEIF R5 = 'X'.

Perform Screen_opt_name1 USING 'field1' '0' '1'.

ELSEIF R4 = 'X'.

Perform Screen_opt_name2 USING 'field2' '0' '1'.

ENDIF.

ENDCASE.

Let me know in case of any problem.

Thanks,

Sri.

0 Kudos

Thanks Sri. Its working

Former Member
0 Kudos

Hi Pavan,

Just try the below code:

loop  at screen.
if p_rad2 eq 'X' and screen-group1 = 'G2'.
screen-active = 0.
screen-invisible = 1.

endif.


modify screen.
endloop.

Best of luck!!

Regards

Ravi