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

Hide radio button upon click

Former Member
0 Likes
3,593

Good day experts.

I would like to ask help how to do this stuff.

I have two main radio button. Let say radA and radB. On radB, I have another two radio buttons. Let say radB1 and radB2.

Initially, I must only see radA and radB. Upon I click radB, thats the only time, radB1 and radB2 will appear. And when I click radA, radB1 and radB2 disappear.

thanks for your help.

10 REPLIES 10
Read only

Former Member
0 Likes
2,017

hi

check out this thread

this might help you

regards

Aakash Banga

Read only

Former Member
0 Likes
2,017

Hi,

You can achieve this in the PBO.

DATA : rada VALUE 'X',

radb,

rada1,

rada2,

radb1,

radb2.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

IF rada = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'R1'.

screen-invisible = 0.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'R2'.

screen-invisible = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*assign a group to radio buttons *

Try this out, Just i checked it and working fine

Regards

Ramc

Edited by: ramchander krishnamraju on Dec 16, 2008 6:08 AM

Read only

0 Likes
2,017

thank you friend. I just modify your code, and I got the answer..

"heres the code:

PARAMETERS: rada RADIOBUTTON GROUP rd1 DEFAULT 'X' USER-COMMAND rd,

radb RADIOBUTTON GROUP rd1, "MODIF ID p2,

radb1 RADIOBUTTON GROUP rd2, "MODIF ID p2,

radb2 RADIOBUTTON GROUP rd2. " MODIF ID p2

.

AT SELECTION-SCREEN OUTPUT.

IF rada = 'X'.

LOOP AT SCREEN.

IF screen-name = 'RADB1'.

screen-invisible = 1.

ENDIF.

IF screen-name = 'RADB2'.

screen-invisible = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF radb = 'X'.

LOOP AT SCREEN.

IF screen-name = 'RADB1'.

screen-invisible = 0.

ENDIF.

IF screen-name = 'RADB2'.

screen-invisible = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

Read only

Former Member
0 Likes
2,017

Hi,

Try like this:

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS : rdA RADIOBUTTON GROUP rg1 DEFAULT 'X',

rdB RADIOBUTTON GROUP rg1,

rdB1 RADIOBUTTON GROUP rg2 modif id rdb,

rdB2 RADIOBUTTON GROUP rg2 modif id rdb.

SELECTION-SCREEN END OF BLOCK b1.

at selection-screen output.

if rdA = 'X'.

loop at screen.

if screen-group1 = 'RDB'.

screen-active = 0.

modify screen.

endif.

endloop.

elseif rdB = 'X'.

loop at screen.

if screen-group1 = 'RDB'.

screen-active = 1.

modify screen.

endif.

endloop.

endif.

Regards,

Bhaskar

Read only

Former Member
0 Likes
2,017

HI,

try ths



  FIELD : rb,
          rb
          MODULE modify AT CURSOR-SELECTION.


******
IF rb EQ 'X'.
    LOOP AT SCREEN.
      IF ( screen-group1 EQ 'ABC' ).
        screen-invisible = 0.
        screen-active = 1.
      ELSEIF ( screen-group1 EQ 'DEF' ).
        screen-invisible = 1.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.

  ELSE.
    LOOP AT SCREEN.
      IF ( screen-group1 EQ 'DEF' ).
        screen-invisible = 0.
        screen-active = 1.
      ELSEIF ( screen-group1 EQ 'ABC' ).
        screen-invisible = 1.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

ENDMODULE.      

put rbB1,rdB2 in one group and rdA1,rdA2 in othr group

hope ths help u

regards,

Ritesh JHa

Read only

Former Member
0 Likes
2,017

Hello

Its working try given below code.

this is the statement of screen from where we call the buttons.

we will write both the button in field.as per the given below code.

PROCESS BEFORE OUTPUT.

MODULE status_8000. "PBO OF SCREEN NUMBER8000.

PROCESS AFTER INPUT. "PAI OF SCREEN NUMBER 8000.

  • MODULE USER_COMMAND_8000.

FIELD : rbA,

rbB

MODULE modify AT CURSOR-SELECTION.

"WE USE AT CURSOR SELECTION STATEMENT WITH MODULE NAME.

"THIS IS THE CODE OF PBO SCREEN.

MODULE status_8000 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

IF rbA EQ 'X'.

LOOP AT SCREEN.

IF ( screen-group1 EQ 'ABC' ).

screen-invisible = 0.

screen-active = 1.

ELSEIF ( screen-group1 EQ 'DEF' ).

screen-invisible = 1.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF ( screen-group1 EQ 'DEF' ).

screen-invisible = 0.

screen-active = 1.

ELSEIF ( screen-group1 EQ 'ABC' ).

screen-invisible = 1.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

ENDMODULE. " STATUS_8000 OUTPUT

&----


*& Module MODIFY INPUT

&----


  • text

----


"THIS CODE WE WILL WRITE IN PAI SCREEN.

MODULE modify INPUT.

IF rbA EQ 'X'.

LOOP AT SCREEN.

IF ( screen-group1 EQ 'ABC' ).

screen-invisible = 0.

screen-active = 1.

ELSEIF ( screen-group1 EQ 'DEF' ).

screen-invisible = 1.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF ( screen-group1 EQ 'DEF' ).

screen-invisible = 0.

screen-active = 1.

ELSEIF ( screen-group1 EQ 'ABC' ).

screen-invisible = 1.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

ENDMODULE. " MODIFY INPUT

THANKS-

ARUN KAYAL

Read only

Former Member
0 Likes
2,017

hi,

use Modif id .

PARAMETERS : rdA RADIOBUTTON GROUP rg1 DEFAULT 'X',

rdB RADIOBUTTON GROUP rg1,

rdB1 RADIOBUTTON GROUP rg2 modif id rdb,

rdB2 RADIOBUTTON GROUP rg2 modif id rdb.

at selection-screen output.

loop at screen.

if screen-group1 = 'RDB'.

screen-active = 0.

modify screen.

endif.

if rdB = 'X'.

if screen-group1 = 'RDB'.

screen-active = 1.

modify screen.

endif.

endloop.

thanks

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,017

Hi Levis 501,

As per your requirements, you have four radiobuttons:-

radA, radB, radB1 and radB2.

Initially, you want only 'radA' and 'radB' (define a group for these two radiobuttons so that on one of them can be selected at a time).

Take the group1 of 'radB1' and 'radB2' as 'ABC' in the attributes of radiobutton,

and for 'rada' and 'radb' keep function group as 'CS' and function type as 'S'.

Using this on changing the selection of radiobuttons 'rada' and 'radb', the radiobuttons 'radB1' and 'radB2' will be enabled/disabled (no need to press any key for generating event).

Use this code:-

In the top module, include code:-


DATA : rada(1) value 'X', "initially checked when you execute
       radb(1),
       radb1(1),
       radb2(1).

On screen flow logic.


PROCESS BEFORE OUTPUT.
 MODULE modify_screen.

In PBO, for module 'modify_screen', use code:-


IF rada = 'X'.
  LOOP AT SCREEN.
    IF ( screen-group1 EQ 'ABC' ).
      screen-invisible = 1.
      screen-active = 0.
    ENDIF.
    MODIFY SCREEN. 
  ENDLOOP.
ELSEIF radb = 'X'.
  LOOP AT SCREEN.
    IF ( screen-group1 EQ 'ABC' ).
      screen-invisible = 0.
      screen-active = 1.
    ENDIF.
    MODIFY SCREEN. 
  ENDLOOP.
ENDIF.

This will enable/disable the radiobuttons as per your requirements.

Hope this solves your problem.

Thanks & Regards

Tarun Gambhir

Read only

Former Member
0 Likes
2,017

Hi,

use loop at screen method as all others have suggested.

Thanks.

Read only

Former Member
0 Likes
2,017

HI ,

This will solve ur purpose ,

Pls go throgh the following code,

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS : r3 RADIOBUTTON GROUP g2 MODIF ID SC1,

r4 RADIOBUTTON GROUP g2 MODIF ID SC1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-006.

PARAMETERS : r1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND ucomm,

r2 RADIOBUTTON GROUP g1 .

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF R1 = 'X' .

IF screen-group1 = 'SC2'.

screen-input = 0.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ELSE.

IF screen-group1 = 'SC1' .

screen-input = 0.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

regards ,

Ajit