Skip to Content
author's profile photo Former Member
Former Member

Radio Button

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 09:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 09:42 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 09:49 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 09:18 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 09:20 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 09:26 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 10:07 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.