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

Former Member
0 Kudos

Hi All,

There are 2 radio button, i click one of the radio button shud display 2 file path fields to upload these files, one for demand and another for stock.

selection-screen begin of block a1 with frame title text-010.

parameters r1 RADIOBUTTON GROUP radi DEFAULT 'X'.

parameters r2 RADIOBUTTON GROUP radi.

selection-screen end of block a1.

selection-screen begin of block b1 with frame title text-020.

*If r1 "X".

parameters pa_ifil1 type trfile default

'/c/data.tmp'.

parameters pa_ifil2 type trfile default

'/c/data.tmp1'.

*Elseif r2 'X'.

parameters pa_ifil3 type trfile default

'/c/data.tmp3'.

parameters pa_ifil4 type trfile default

'/c/data.tmp4'.

*endif.

selection-screen end of block b1.

how do i do it

regards

AB

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

selection-screen begin of block a1 with frame title text-010.

parameters r1 RADIOBUTTON GROUP radi DEFAULT 'X'

USER-COMMAND radio.

parameters r2 RADIOBUTTON GROUP radi.

selection-screen end of block a1.

selection-screen begin of block b1 with frame title text-020.

parameters pa_ifil1 type trfile default

'/c/data.tmp' MODIF ID mod.

parameters pa_ifil2 type trfile default

'/c/data.tmp1' MODIF ID mod.

parameters pa_ifil3 type trfile default

'/c/data.tmp3' MODIF ID chg.

parameters pa_ifil4 type trfile default

'/c/data.tmp4' MODIF ID chg.

*endif.

selection-screen end of block b1.

AT SELECTION-SCREEN OUTPUT.

If r1 EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 EQ 'MOD'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF screen-group1 EQ 'CHG'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 EQ 'MOD'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF screen-group1 EQ 'CHG'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 4:55 PM

8 REPLIES 8

Former Member
0 Kudos

You will have to LOOP AT SCREEN at the event AT SELECTION-SCREEN... and hide either of the PARAMETERS depending on the value of your radiobutton-group

Edited by: Mike Schernbeck on Apr 10, 2008 11:18 AM

Former Member
0 Kudos

Hi,

Refer to the following code:

***File Selection

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

***PC File

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN POSITION 01.

PARAMETERS: r_pc RADIOBUTTON GROUP g2 DEFAULT 'X' USER-COMMAND ucom.

SELECTION-SCREEN COMMENT 3(16) text-005.

SELECTION-SCREEN POSITION 33.

PARAMETERS: p_pc LIKE rlgrap-filename MODIF ID sc1.

SELECTION-SCREEN END OF LINE.

***UNIX File

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN POSITION 01.

PARAMETERS: r_unix RADIOBUTTON GROUP g2 .

SELECTION-SCREEN COMMENT 3(16) text-006.

SELECTION-SCREEN POSITION 33.

PARAMETERS: p_unix LIKE rlgrap-filename MODIF ID sc2 .

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b2.

FORM f_screen_validations .

LOOP AT SCREEN.

IF r_pc IS NOT INITIAL.

IF screen-name = 'P_UNIX'.

screen-input = '0'.

p_unix = ''.

MODIFY SCREEN.

CONTINUE.

ENDIF.

ELSE.

IF screen-name = 'P_PC'.

screen-input = '0'.

p_pc = ''.

MODIFY SCREEN.

CONTINUE.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM.

Hope this helps.

<REMOVED BY MODERATOR>

Regards,

Sipra

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 4:54 PM

Former Member
0 Kudos

Hi,

see this code.


selection-screen begin of block a1 with frame title text-010.
parameters r1 RADIOBUTTON GROUP radi DEFAULT 'X' USER-COMMAND ucom.
parameters r2 RADIOBUTTON GROUP radi.
selection-screen end of block a1.

selection-screen begin of block b1 with frame title text-020.
parameters pa_ifil1 type trfile.
parameters pa_ifil2 type trfile.
selection-screen end of block b1.

AT SELECTION-SCREEN OUTPUT.
If r1 = 'X'.
  pa_ifil1 = '/c/data.tmp'.
  pa_ifil2 = '/c/data.tmp1'.
Elseif r2 = 'X'.
  pa_ifil1 = '/c/data.tmp3'.
  pa_ifil2 = '/c/data.tmp4'.
endif.

rgds,

bharat.

Former Member
0 Kudos

Hi,

Correct your code as shown below.

selection-screen begin of block a1 with frame title text-010.

parameters r1 RADIOBUTTON GROUP radi DEFAULT 'X' user-command rusr.

parameters r2 RADIOBUTTON GROUP radi.

selection-screen end of block a1.

selection-screen begin of block b1 with frame title text-020.

*If r1 "X".

parameters pa_ifil1 type trfile default

'/c/data.tmp' modif id abc.

parameters pa_ifil2 type trfile default

'/c/data.tmp1' modif id abc.

*Elseif r2 'X'.

parameters pa_ifil3 type trfile default

'/c/data.tmp3' modif id xyz.

parameters pa_ifil4 type trfile default

'/c/data.tmp4' modif id xyz.

*endif.

selection-screen end of block b1.

initialization.

pa_ifil1 = '/c/data.tmp'.

pa_ifil2 = '/c/data.tmp1'.

pa_ifil3 = '/c/data.tmp3'.

pa_ifil4 = '/c/data.tmp4'.

AT SELECTION-SCREEN OUTPUT.

loop at screen.

if screen-group1 = 'ABC'.

If r1 = 'X'.

screen-active = 1.

else.

screen-active = 0.

endif.

elseif screen-group1 = 'XYZ'.

If r2 = 'X'.

screen-active = 1.

else.

screen-active = 0.

endif.

endif.

modify screen.

endloop.

Former Member
0 Kudos

Hi,

selection-screen begin of block a1 with frame title text-010.

parameters r1 RADIOBUTTON GROUP radi DEFAULT 'X'

USER-COMMAND radio.

parameters r2 RADIOBUTTON GROUP radi.

selection-screen end of block a1.

selection-screen begin of block b1 with frame title text-020.

parameters pa_ifil1 type trfile default

'/c/data.tmp' MODIF ID mod.

parameters pa_ifil2 type trfile default

'/c/data.tmp1' MODIF ID mod.

parameters pa_ifil3 type trfile default

'/c/data.tmp3' MODIF ID chg.

parameters pa_ifil4 type trfile default

'/c/data.tmp4' MODIF ID chg.

*endif.

selection-screen end of block b1.

AT SELECTION-SCREEN OUTPUT.

If r1 EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 EQ 'MOD'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF screen-group1 EQ 'CHG'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 EQ 'MOD'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF screen-group1 EQ 'CHG'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 4:55 PM

venkat_o
Active Contributor
0 Kudos

Hi , Check this sample program. It works as u expected.

REPORT zvenkat_test2.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:rad1 RADIOBUTTON GROUP gr1 USER-COMMAND ucm1 DEFAULT 'X',
           rad2 RADIOBUTTON GROUP gr1.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text1 FOR FIELD p_path1.
PARAMETERS:p_path1 TYPE localfile.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text2 FOR FIELD p_path2.
PARAMETERS:p_path2 TYPE localfile.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text3 FOR FIELD p_path3.
PARAMETERS:p_path3 TYPE localfile.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text4 FOR FIELD p_path4.
PARAMETERS:p_path4 TYPE localfile.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b2.

INITIALIZATION.
  text1 = 'File1'.
  text2 = 'File2'.
  text3 = 'File3'.
  text4 = 'File4'.

AT SELECTION-SCREEN OUTPUT.
  IF rad1 = 'X'.
    LOOP AT SCREEN .
      IF screen-name = 'P_PATH1' OR
         screen-name = 'TEXT1'   OR
         screen-name = 'P_PATH2' OR
         screen-name = 'TEXT2'   .
        screen-active = '0'.
        MODIFY SCREEN.
        CLEAR screen.
      ENDIF.
    ENDLOOP.
  ELSEIF rad2 = 'X'.
    LOOP AT SCREEN .
      IF screen-name = 'P_PATH3' OR
         screen-name = 'TEXT3'   OR
         screen-name = 'P_PATH4' OR
         screen-name = 'TEXT4'   .
        screen-active = '0'.
        MODIFY SCREEN.
        CLEAR screen.
      ENDIF.
    ENDLOOP.
  ENDIF.
Regards, Venkat.O

Former Member
0 Kudos

Hello Abuser,

<REMOVED BY MODERATOR> So by doing this you can help both the contributors and can also helps future readers,they can quickly view best suitable answer for this Query

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 4:56 PM

0 Kudos

hi,

Thanks everyone espcially murali. It helped a lot and issue is solved i given points for all helpfull answers. Just took time since i had to complete something.

Sorry and Thanks

Regards

Ab