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

Dynamic selection screen.

Hi Gurus,

My requirement as follows...

Block 1 contains 2 radio buttons.

Block 2 contains couple of select options.

Block 3 contains couple of different select options.

First radio button is set as default. so Block 2 should appear below block 1 as default.

If second radio button is selected Block 2 should be hidden and Block 3 should appear in the place of

Block 2.

Depending upon the Select options the report continues.

Please Help me out on this issue.

(I found few questions same as this previously posted but didnt exactly the same).

Awaiting for early replies.

regards,

deep.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2009 at 11:13 AM

    Hi,

    Check this code.

    SELECTION-SCREEN BEGIN OF BLOCK 001.

    PARAMETERS: P_MRU RADIOBUTTON GROUP SEL DEFAULT 'X' USER-COMMAND AC,

    P_PART RADIOBUTTON GROUP SEL.

    SELECT-OPTIONS P1 FOR <field> MODIF ID PRT.

    SELECT-OPTIONS P2 FOR <field> MODIF ID PRT.

    SELECT-OPTIONS G1 FOR <field> MODIF ID MRU.

    SELECT-OPTIONS G2 FOR <field> MODIF ID MRU.

    SELECTION-SCREEN END OF BLOCK 001.

    AT SELECTION-SCREEN OUTPUT.

    IF P_MRU = 'X'.

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 = 'PRT'.

    SCREEN-INPUT = '0'.

    ENDIF.

    IF SCREEN-GROUP1 = 'MRU'.

    SCREEN-INPUT = '1'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ELSEIF P_PART = 'X'.

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 = 'MRU'.

    SCREEN-INPUT = '0'.

    ENDIF.

    IF SCREEN-GROUP1 = 'PRT'.

    SCREEN-INPUT = '1'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ENDIF.

    Regards,

    Bharat Kalagara.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Now change it as.

      SELECTION-SCREEN: BEGIN OF BLOCK block2 WITH FRAME.
      
      SELECT-OPTIONS:pernr FOR pa0001-pernr DEFAULT '1234'  MODIF ID s2.
      SELECT-OPTIONS:begda FOR pa0001-begda  DEFAULT '20081201'  MODIF ID s2.
      SELECT-OPTIONS:endda FOR pa0001-endda DEFAULT '20081201'  MODIF ID s2.
      
      SELECTION-SCREEN: END OF BLOCK block2.

      if it is not so as u required, then please make more clear what actually u want

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2009 at 10:29 AM

    hi,

    at selection-screen output.
    
    "  NOTE : Modif ID for all the select-options in the block 2 should have the same value for example BL2 
    " and all the select-options for block3 should have the same value for example BL3.
    
    if radio1 = 'X'.
    loop at screen.
      if screen-group1 = 'Modif ID the select options of Block 3'.
          screen-active = 0.
          modify screen.
      endif.
    endloop.
    else.
    loop at screen.
      if screen-group1 = 'Modif ID the select options of Block 2'.
          screen-active = 0.
          modify screen.
      endif.
    endloop.
    endif.

    Regards,

    Siddarth

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 28, 2009 at 10:26 AM

    Plz try this code...

    
    REPORT  ZTEST_CHECK                             .
    
    
    parameters: p_sale radiobutton group g1 user-command ABC default 'X',
                p_mate radiobutton group g1 .
    
    selection-screen: begin of block b0 with frame.
    parameters: p_vbeln like vbak-vbeln modif id ABC.
    selection-screen: end of block b0.
    
    selection-screen: begin of block b1 with frame.
    parameters :  p_matnr like mara-matnr modif id XYZ.
    selection-screen: end of block b1.
    
    
    
    at selection-screen output.
    
    if p_sale = 'X'.
    
    loop at screen.
    if screen-group1 = 'ABC'.
    screen-active = 0.
    endif.
    modify screen.
    endloop.
    endif.
    
    if p_mate = 'X'.
    loop at screen.
    if screen-group1 = 'XYZ'.
    screen-active = 0.
    endif.
    modify screen.
    endloop.
    endif.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2009 at 10:39 AM

    Hi.

    Test the following code

    TABLES: kna1 , pa0001.
    
    
    PARAMETERS: rd1 RADIOBUTTON GROUP g1 USER-COMMAND cmd DEFAULT 'X',
                rd2 RADIOBUTTON GROUP g1 .
    
    SELECTION-SCREEN: BEGIN OF BLOCK block1 WITH FRAME.
    
    SELECT-OPTIONS:kunnr FOR kna1-kunnr MODIF ID s1.
    SELECT-OPTIONS:name1 FOR kna1-name1 MODIF ID s1.
    SELECT-OPTIONS:name2 FOR kna1-name2 MODIF ID s1.
    
    SELECTION-SCREEN: END OF BLOCK block1.
    
    
    SELECTION-SCREEN: BEGIN OF BLOCK block2 WITH FRAME.
    
    SELECT-OPTIONS:pernr FOR pa0001-pernr MODIF ID s2.
    SELECT-OPTIONS:begda FOR pa0001-begda MODIF ID s2.
    SELECT-OPTIONS:endda FOR pa0001-endda MODIF ID s2.
    
    SELECTION-SCREEN: END OF BLOCK block2.
    
    
    
    AT SELECTION-SCREEN OUTPUT.
    
      IF rd1 = 'X'.
    
        LOOP AT SCREEN.
          IF screen-group1 = 'S2'.
            screen-active = 0.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    
      IF rd2 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'S1'.
            screen-active = 0.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi all,

      Thanks for all you replies.....The code works well....

      But still there is a problem.

      In block 2 there is an obligatory field (mandatory), so if i check the second radio button it prompts me to enter a value in that field and doesnt gets changed to block 3.

      Note :Block 3 also contains an obligatory field.

      (On removing this obligatory field the code works well...)

      regards,

      deep.

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.