Skip to Content
author's profile photo
Former Member

Disabling a block on selection screen

Hi Guys,

Can somebody please give me a code if for example, I have 2 blocks in my selection screen and I have two radiobuttons to choose from. Each radiobutton corresponds to a particular block on the screen. If I choose the 1st radiobutton, I want the whole of second block disabled and vice-versa.

I would really appreciate your help.

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    Oct 06, 2005 at 06:31 AM

    Hi,

    You have to use the event 'at selection-screen output' and LOOP AT SCREEN to disable the block.

    An example program can be found at.

    selection screen, dynamic enable and disable of blocks

    Cheers

    Vinod

    Message was edited by: Vinod C

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 06, 2005 at 06:32 AM

    u can disable the block

    loop on screen and check for the screen-name equals to block and do screen-input = 0.

    all the best

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 06, 2005 at 06:50 AM

    SELECTION-SCREEN BEGIN OF BLOCK B1.

    SELECT-OPTIONS:

    s1 for vabk-vbeln modif id ORD,

    s2 for vbak-vkorg modif id ORD,

    s3 for vbap-posnr modif id ITM,

    s4 for vbap-posnr modif id ITM.

    SELECTION-SCREEN END OF BLOCK B1.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 = 'ORD'.

    SCREEN-INPUT = '0'.

    refresh S1.

    refresh S2.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi!

      Thanks to everyone who provided their inputs. It was such a quick answer and all your inputs helped solved my problem.

      Best regards.

  • Oct 06, 2005 at 06:35 AM

    In the event AT SELECTION SCREEN OUTPUT you can do

    a LOOP AT SCREEN and turn off the ACTIVE

    indicator.

    Use the debugger to determine what the name of the

    field is that you want to hide.

    So something like

    *Code used to Initiate the 'AT selection-screen'

    EVENT from radiobuttons.

    selection-screen begin of block group with frame 
    title text-s04.
    parameters: p_sel1 type c radiobutton group sel 
    <b>user-command upd.</b>
    parameters: p_sel2 type c radiobutton group sel.
    selection-screen end of block group.
    
    
    LOOP AT SCREEN.  
    IF SCREEN-FIELDNAME = 'the name'. 
       SCREEN-ACTIVE = '0'.  
      MODIFY SCREEN.
    ENDLOOP.

    Check this sample code with three radio buttons.

    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-h01.
    *Radio button for Process PO invoice
    PARAMETERS :   rb_po   RADIOBUTTON GROUP inv USER-COMMAND rad.
    *Radio button for FI Invoice
    PARAMETERS :   rb_fi   RADIOBUTTON GROUP inv.
    *Radio button for Process PO & FI Invoice
    PARAMETERS :     rb_pofi   RADIOBUTTON GROUP inv.
    
    SELECTION-SCREEN END OF BLOCK b3.
    
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    
    SELECT-OPTIONS: s_bukrs FOR rbkp-bukrs,   "Company Code
                    s_ekorg FOR ekko-ekorg NO INTERVALS MODIF ID md2,   "Purchasing Org.
    	s_ekgrp FOR ekko-ekgrp NO INTERVALS MODIF ID md2,
                                            "Purchasing Group
          s_werks FOR rseg-werks NO INTERVALS MODIF ID md2,
    	        "Plant
          s_lifnr FOR rbkp-lifnr NO INTERVALS,           "Vendor
          s_matkl FOR ekpo-matkl NO INTERVALS                 MODIF ID md1,   "Material Group
          s_belnr FOR rbkp-belnr NO INTERVALS,
                                        "Invoice Number
          s_ebeln FOR rseg-ebeln NO INTERVALS MODIF ID md2,
                                  "Purchasing Document No
          s_gjahr FOR rbkp-gjahr NO INTERVALS,
                                      "Fiscal year
          s_budat FOR  rbkp-budat NO INTERVALS,
                                          "Posting date
          s_blart   FOR  bkpf-blart NO INTERVALS,
                                    " Document Type
          s_bldat   FOR  bkpf-bldat NO INTERVALS,
                                     " Invoice Date      s_usnam   FOR  rbkp-usnam NO INTERVALS.
    "User
    ****************************************************************
    *Report type
    ****************************************************************
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN BEGIN OF LINE.
    *Radio button for User Report
    PARAMETERS :     rb_user  RADIOBUTTON GROUP za DEFAULT 'X' <b>USER-COMMAND rad MODIF ID md2.</b>
    "User report
    SELECTION-SCREEN COMMENT 3(20) text-003 FOR FIELD rb_user <b>MODIF ID md2.</b>
    SELECTION-SCREEN END OF LINE.
    
    SELECTION-SCREEN BEGIN OF LINE.
    *Radio button for Managing Report
    PARAMETERS :     rb_man   RADIOBUTTON GROUP za
                                         <b> MODIF ID md2.</b>
    "Management Report
    SELECTION-SCREEN COMMENT 3(20) text-004 FOR FIELD rb_man
                                           <b> MODIF ID md2.</b>
    SELECTION-SCREEN END OF LINE.
    
    SELECTION-SCREEN END  OF BLOCK b2.
    
    SELECTION-SCREEN END  OF BLOCK b1.
    
    
    <b>AT SELECTION-SCREEN OUTPUT.</b>
    
    * Checking Radiobuttons and modifing Material Group field  .
      PERFORM f13000_check_radio.
    
    
    FORM f13000_check_radio.
    * When the FI button is selected hide the fields under group md1 and MD2
      LOOP AT SCREEN.
    <b>    IF screen-group1 = 'MD2'
        OR screen-group1 = 'MD1'.</b>
          IF rb_fi  = c_x
          OR rb_pofi = c_x.
            screen-active = 0.
          ELSE.
            screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    
    * If the user output radiobutton is checked then make the screen
    * input of Material Group off
      LOOP AT SCREEN.
    <b>    IF screen-group1 = 'MD1'.</b>
          IF rb_user = 'X'.
            screen-active = 0.
          ELSE.
            screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    
      IF <b>rb_user = 'X'.</b>
    *   When display for material group is off
    *   then refresh the select option for material
    *   group
        REFRESH s_matkl.
      ENDIF.
    ENDFORM.      " f13000_check_radio
    

    Message was edited by: Judith Jessie Selvi

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 06, 2005 at 06:44 AM

    Hi,

    Check this link,

    http://help.sap.com/saphelp_erp2004/helpdata/en/79/34a23dd9b511d1950e0000e8353423/frameset.htm>

    Hope it helps u.

    Kindly reward points if u find it useful.

    Thanks&Regards,

    Ruthra

    Add comment
    10|10000 characters needed characters exceeded