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

Dynamic selection screen change in Selection Screen.

Hi Experts,

I am not getting dynamic screen change on selection screen. can you give solution for the following scenario.

I have 3 radio buttons on selection screen. Example: R1, R2, R3.

I have 5 fields on selection screen. Example : F1, F2, F3, F4, F5.

When i select radio button 1 i will get F1 field screen only.

When i select radio button 2 or 3 i will get F2 and F3 fields screen only.

When i select radio button 3 i will get F4 and F5 fields screen only.

Any one give me solution for the above scenario very much thankful.

Thanks in advance,

Sai

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2009 at 11:14 AM

    Hi Sai,

    Following code works according to ur requirement......

    parameters:
    P_r1 radiobutton group RAD user-command COM1,
    p_r2 radiobutton group RAD,
    p_r3 radiobutton group RAD,
    
    p_fld1 type i modif id MD2,
    p_fld2 type i modif id MOD,
    p_fld3 type i modif id MOD,
    
    p_fld4 type i modif id MD1,
    p_fld5 type i modif id MD1.
    
    at selection-screen output.
      if p_r2 = 'X'.
        loop at screen.
        if screen-group1 = 'MD2' OR screen-group1 = 'MD1' .
          screen-active  = 0.
          modify screen.
        ENDIF.
      endloop.
    
    ELSEif p_r3 = 'X'.
        loop at screen.
        if screen-group1 = 'MOD' OR screen-group1 = 'MD2' .
          screen-active  = 0.
          modify screen.
        ENDIF.
      endloop.
    ELSE.
      loop at screen.
        if screen-group1 = 'MOD' OR screen-group1 = 'MD1' .
          screen-active  = 0.
          modify screen.
        ENDIF.
      endloop.
    endif.
    
    

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sai,

      According to my understanding of ur requirement u want the same fields 'fld2 fld3' to be displayed on selection of

      Radio Button 2 or Radio Button 3..

      and r u not going to display field4 & field5..

      Kindly chk the following modified code..

      parameters:
      P_r1 radiobutton group RAD user-command COM1,
      p_r2 radiobutton group RAD,p_r3 radiobutton group RAD,
      p_r4 radiobutton group RAD,
      
      p_fld1 type i modif id MD2,
      p_fld2 type i modif id MOD,
      p_fld3 type i modif id MOD,
      
      p_fld4 type i modif id MD1,
      p_fld5 type i modif id MD1.
      
      at selection-screen output.
        if p_r2 = 'X' or p_r3 = 'X'.
          loop at screen.
          if screen-group1 = 'MD2' OR screen-group1 = 'MD1' .
            screen-active  = 0.
            modify screen.
          ENDIF.
        endloop.
      " in case radio button 4 not required remove this elseif part of coding..
      ELSEif p_r4 = 'X'.
          loop at screen.
          if screen-group1 = 'MOD' OR screen-group1 = 'MD2' .
            screen-active  = 0.
            modify screen.
          ENDIF.
        endloop.
      ELSE.
        loop at screen.
          if screen-group1 = 'MOD' OR screen-group1 = 'MD1' .
            screen-active  = 0.
            modify screen.
          ENDIF.
        endloop.
      endif.
      

      Regards,

      Mdi.Deeba

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2009 at 10:50 AM

    Use AT-SELECTION SCREEN OUTPUT event and in that loop the screen internal table which contains the details about all your screen fields and in the screen internal table we have attribute called as INVISIBLE, just pass 'X' to that.

    Vishwa

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2009 at 10:53 AM

    Hi Sai,

    Check below similar code snippet. You just need to modify acording to your requirement.

    PARAMETERS : p_rb1 RADIOBUTTON GROUP grp1 USER-COMMAND ucom DEFAULT 'X',
                 p_rb2 RADIOBUTTON GROUP grp1.
    SELECT-OPTIONS s_matnr FOR mara-matnr MODIF ID nit.
    
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'NIT'.
          IF p_rb1 EQ 'X'.
            screen-active = 0.
          ELSE.
            screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.

    Thanks

    Nitesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2009 at 10:53 AM

    Code your requirement in event AT-SELECTION SCREEN OUTPUT .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2009 at 10:57 AM
    PARAMETERS: P_R1 RADIOBUTTON GROUP g1 DEFAULT 'X'
                USER-COMMAND WHAT.
    PARAMETERS: P_R2 RADIOBUTTON GROUP g1.
    
    
    SELECT-OPTIONS: S_1 FOR Z-1,
                                  S_2 FOR Z-2 MODIF ID R1,
                                  S_3 FOR Z-3 MODIF ID R2,
    
    * ---------------------------------------------------------------------*
    *     At selection Screen (Radiobuttons)                               *
    * ---------------------------------------------------------------------*
    AT SELECTION-SCREEN OUTPUT.
      IF P_R1 = ' '.
        LOOP AT SCREEN.
          CHECK SCREEN-GROUP1 NE SPACE.
          IF SCREEN-GROUP1 EQ 'R2' OR
             SCREEN-GROUP1 EQ 'R3'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 26, 2009 at 10:59 AM

    Hi,

    In AT SELECTION SCREEN OUTPUT

    LOOP AT SCREEN.
    IF R1 = 'X'.
     IF screen-name = 'F1'.
      screen invisible = 1.
      MODIFY SCREEN.
     ENDIF.
    ELSEIF R2 = 'X'.
    IF screen-group = 'G1'.
      screen invisible = 1.
      MODIFY SCREEN.
     ENDIF.
    ELSEIF R2 = 'X'.
     IF screen-group = 'G2'.
      screen invisible = 1.
      MODIFY SCREEN.
     ENDIF.
    ENDIF.
    ENDLOOP.

    Thanks,

    Sri.

    Edited by: Sri on Aug 26, 2009 4:30 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2009 at 11:00 AM

    Hi,

    you can try the logic below, i have entered.

    Below code has 2 radiobuttons and two parameters.

    For radio button1 field 1 will be input enabled.

    For radio button2 field 2 will be input enabled.

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

    SELECTION-SCREEN skip.

    PARAMETERS: R! RADIOBUTTON GROUP B1 DEFAULT 'X' USER-COMMAND COM1,

    R2 RADIOBUTTON GROUP B1.

    SELECTION-SCREEN skip.

    SELECTION-SCREEN END OF BLOCK B1.

    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

    SELECTION-SCREEN skip.

    PARAMETERS:F1 TYPE field1,

    F2 TYPE field2.

    SELECTION-SCREEN skip.

    SELECTION-SCREEN END OF BLOCK B2.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    IF R1 = 'X' AND

    SCREEN-NAME = 'parameter2 name'.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ELSEIF R2 = 'X' AND

    SCREEN-NAME = 'parameter1 name''.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    Regards,

    Rajesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 06:01 AM

    Hi

    try this code,

    REPORT ZTEST_3RB.

    TABLES : KNA1,EKKO,VBRK.

    PARAMETERS : SALES RADIOBUTTON GROUP VIJJ USER-COMMAND VJY ,

    PUR RADIOBUTTON GROUP VIJJ ,

    BILL RADIOBUTTON GROUP VIJJ ,

    TOTAL AS CHECKBOX.

    SELECT-OPTIONS : S_CUSTNO FOR KNA1-KUNNR MODIF ID AKP DEFAULT 1000 TO 1033,

    S_PONO FOR EKKO-EBELN MODIF ID VKP,

    S_BNO FOR VBRK-VBELN MODIF ID PKP.

    INITIALIZATION.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    IF SALES = 'X'.

    IF SCREEN-GROUP1 = 'VKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP1 = 'PKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    ELSEIF PUR = 'X'.

    IF SCREEN-GROUP1 = 'PKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP1 = 'AKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    ELSEIF BILL = 'X'.

    IF SCREEN-GROUP1 = 'AKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP1 = 'VKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDIF.

    ENDLOOP.

    i think this will help your problem,

    Regards,

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

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.