How to handle Event when a radio button in selection screen is clicked

Hi all,
   What is the Event generated when a radio button is clicked in the selection Screen. My requirement is .If one radio button is clicked a field in selection screen should be greyed.
   Here I used AT SELECTION-SCREEN OUTPUT. but this event is generated only if i press 'ENTER' after clicking the radio button in the selection screen.
   Is there any other way to process this radio button event?
Thanks&Best Regards,
Vishnu

hi,
try like this
TABLES : kna1,lfa1.
SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-002.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : rad_but1 RADIOBUTTON GROUP one DEFAULT 'X' USER-COMMAND ucom.
SELECTION-SCREEN COMMENT 3(26) text-003.
SELECT-OPTIONS : kunnr FOR kna1-kunnr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : rad_but2 RADIOBUTTON GROUP one .
SELECTION-SCREEN COMMENT 3(26) text-004.
SELECT-OPTIONS : lifnr FOR lfa1-lifnr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN:END OF BLOCK blk1.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF rad_but1 = 'X'.
      IF screen-name = 'KUNNR-LOW' OR screen-name = 'KUNNR-HIGH' .
        screen-input = '1'.
        MODIFY SCREEN.
      ENDIF.
      IF screen-name = 'LIFNR-LOW' OR screen-name = 'LIFNR-HIGH'.
        screen-input = '0'.
        REFRESH lifnr.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
    IF rad_but2 = 'X'.
      IF screen-name = 'KUNNR-LOW' OR screen-name = 'KUNNR-HIGH'.
        REFRESH kunnr.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
      IF screen-name = 'LIFNR-LOW' OR screen-name = 'LIFNR-HIGH'.
        screen-input = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.
reward if usefull....

Similar Messages

  • Radio Buttons on Selection Screen

    Hi,
    I have four radio buttons on selection screen in a frame, all belonging to the same group.
    When the program is called using transaction 1, first two radio buttons are displayed. When the program is called using transaction 2, bottom two radio must be displayed.
    I am doing this using the following code.
    The problem is : When last two are displayed, there is empty space left on the top and first two are displayed there is empty space left in the bottom of the frame. How can this be taken care of such there are no empty spaces in the box frame?
    Code:
    Radio Buttons for Table Name
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-005.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_ot   RADIOBUTTON GROUP grp1 MODIF ID one.
    SELECTION-SCREEN COMMENT 5(31) text-001 FOR FIELD p_ot.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_exp   RADIOBUTTON GROUP grp1 MODIF ID one.
    SELECTION-SCREEN COMMENT 5(31) text-002 FOR FIELD p_exp.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_cost   RADIOBUTTON GROUP grp1 MODIF ID two.
    SELECTION-SCREEN COMMENT 5(31) text-003 FOR FIELD p_cost.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_att   RADIOBUTTON GROUP grp1 MODIF ID two.
    SELECTION-SCREEN COMMENT 5(31) text-004 FOR FIELD p_att.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN END OF BLOCK bl1.
    Initialization
    INITIALIZATION.
    Display Table Names depending on transaction calling the program
      PERFORM display_table_names.
    FORM display_table_names.
      DATA : l_mod_id(3) TYPE c.
      IF sy-tcode EQ 'ZVTEST1'.
        l_mod_id = 'ONE'.
      ELSEIF sy-tcode EQ 'ZVTEST2'.
        l_mod_id = 'TWO'.
      ENDIF.
      LOOP AT SCREEN.
        IF screen-group1 EQ l_mod_id.
          screen-invisible   = '1'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " display_table_names

    Hi,
    REPORT  Z_SALES MESSAGE-ID ZZ                          .
    *                             Variables                                *
    DATA: IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
          IT_MSGS LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA: V_FILE TYPE STRING.
    *                         Internal Tables                              *
    DATA: BEGIN OF IT_SALES OCCURS 0,
            AUART,
            VKORG,
            VTWEG,
            BSTKD,
            KUNNR_KUNAG,
            KUNNR_KUNWE,
            KETDAT,
            KPRGBZ,
            PRSDT,
            BSTKD_1,
            KUNNR_KUNAG1,
            KUNNR_KUNWE1,
            KETDAT_1,
            KPRGBZ_1,
            PRSDT_1,
            ZTERM_1,
            INCO1,
            INCO2,
            MABNR,
            KWMENG,
            BSTKD_2,
            KUNNR_KUNAG2,
            KUNNR_KUNWE2,
            KETDAT_2,
            KPRGBZ_2,
            PRSDT_2,
            ZTERM_2,
            INCO1_1,
            INCO2_2,
            KSCHL,
            KBETR,
          END OF IT_SALES.
    *                       Selection-Screen                               *
    *Selection Screen 1
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_FILE(25) TYPE C,
                 O_FILE(25) TYPE C.
    SELECTION-SCREEN END OF BLOCK B1.
    *Selection Screen 2
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
                SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK B2.
    *Selection Screen 3
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
    PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
                UPDATE DEFAULT 'X' MODIF ID BL1.
    SELECTION-SCREEN END OF BLOCK B3.
    *Selection Screen 4
    SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
    PARAMETERS: SES_NAM(25) MODIF ID BL2,
                KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
                LOC_DATE TYPE SY-DATUM MODIF ID BL2,
                USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
    SELECTION-SCREEN END OF BLOCK B4.
    *                     At  Selection-Screen Output                      *
    AT SELECTION-SCREEN OUTPUT.
      IF CAL_TRA = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'BL1'.
            SCREEN-ACTIVE = '1'.
          ENDIF.
          IF SCREEN-GROUP1 = 'BL2'.
            SCREEN-ACTIVE = '0'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF SESSION = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'BL1'.
            SCREEN-ACTIVE = '0'.
          ENDIF.
          IF SCREEN-GROUP1 = 'BL2'.
            SCREEN-ACTIVE = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    *                     At  Selection-Screen                             *
    AT SELECTION-SCREEN.
      PERFORM VALIDATE_MANDATORY_FIELDS.
    *****************            INITIALIZATION         ********************
    INITIALIZATION.
      LOC_DATE  = SY-DATUM - 1.
    *                       Start of Selection                             *
    START-OF-SELECTION.
      V_FILE = P_FILE.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                = V_FILE
          FILETYPE                = 'ASC'
          HAS_FIELD_SEPARATOR     = ' '
        TABLES
          DATA_TAB                = IT_SALES
        EXCEPTIONS
          FILE_OPEN_ERROR         = 1
          FILE_READ_ERROR         = 2
          NO_BATCH                = 3
          GUI_REFUSE_FILETRANSFER = 4
          INVALID_TYPE            = 5
          NO_AUTHORITY            = 6
          UNKNOWN_ERROR           = 7
          BAD_DATA_FORMAT         = 8
          HEADER_NOT_ALLOWED      = 9
          SEPARATOR_NOT_ALLOWED   = 10
          HEADER_TOO_LONG         = 11
          UNKNOWN_DP_ERROR        = 12
          ACCESS_DENIED           = 13
          DP_OUT_OF_MEMORY        = 14
          DISK_FULL               = 15
          DP_TIMEOUT              = 16
          OTHERS                  = 17.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *&      Form  VALIDATE_MANDATORY_FIELDS
    *       text
    FORM VALIDATE_MANDATORY_FIELDS.
      IF P_FILE IS INITIAL OR O_FILE IS INITIAL.
        MESSAGE E000 WITH 'ENTER BOTH THE FILE NAMES'.
      ENDIF.
      IF CAL_TRA = 'X'.
        IF MODE IS INITIAL OR UPDATE IS INITIAL.
          MESSAGE E000 WITH 'ENTER BOTH THE OPTIONS'.
        ENDIF.
        IF SY-SUBRC <> 0.
          IF MODE <> 'A' OR MODE <> 'E' OR MODE <> 'N'
          OR MODE <> 'a' OR MODE <> 'e' OR MODE <> 'n'.
            MESSAGE E000 WITH 'Mode should be either A, E or N'.
          ENDIF.
          IF UPDATE <> 'S' OR UPDATE <> 'A'
          OR UPDATE <> 's' OR UPDATE <> 'a'.
            MESSAGE E000 WITH 'Mode should be either S or A'.
          ENDIF.
        ENDIF.
      ENDIF.
      IF SESSION = 'x'.
        IF SES_NAM   IS INITIAL
        OR KEP_TRAS  IS INITIAL
        OR LOC_DATE  IS INITIAL
        OR USER      IS INITIAL.
          MESSAGE E000 WITH 'ENTER ALL THE FIELDS'.
        ENDIF.
      ENDIF.
    ENDFORM.                    "VALIDATE_MANDATORY_FIELDS
    Regards
    vijay

  • Radio button in selection screen and push button

    Hi experts,
    I want to give radio button in selection screen side by side.
    how we can do this on slection screen.
    secondly i want to resize push button on selection screen.
    please provide me the exact solution.
    thanks
    babbal

    Hi babbal,
    For Your Requriment yo can go to tcode se51 & then give ur program name & give screen number as 1000 because 1000 is default screen for all the programs and in se51 Press Layout button & then you can make changes to the Selection screen according to your requriment
    Hope it will be Helpfull.......!!
    Thanks & Regards,
    Bhushan

  • How to disable when one radio button is selected

    Hi Folks,
    One of our requirement is as follows,
    Scenario: We have two columns with radio buttons and two dropdown box for the same columns to select the values.
    Requirement: When user select one radio button then the other radio button and its relevant dropdown both is disabled.
    Radio Buttons:
    Company
    EmpNo
    Dropdown Box:
    Company
    EmpNo
    If CompName Radio button is selected then Radio Buttom and Dropdown Box for Policy Id is disabled.
    Finally, The filter is applied on CompName to populate the values in dropdown
    Thanks Guys,
    KK

    look for a function like setActive or setDisable

  • Add radio button when a radio button is selected (pop up)

    How do you Add a 2 radio buttons when (pop up when d1 is
    selected)
    For example d1a and d1b
    When d1 is selected.
    <cfoutput>
    <cfif isdefined("url.msg")>
    #urldecode(url.msg)# <BR />
    </cfif>
    </cfoutput>
    <table border="0" cellpadding="5">
    <form id="form1" name="form1" method="post"
    action="index.cfm?action=actSearch">
    <tr>
    <td>please enter id no: </td>
    <td><input type="text" name="nbr" /></td>
    </tr>
    <tr>
    <td>B1: </td>
    <td><input type="Radio" name="bd" value="b1"
    checked="checked"></td>
    </tr>
    <tr>
    <td>D1: </td>
    <td><input type="Radio" name="bd"
    value="d1r"></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="submit" name="Submit"
    value="Submit" /></td>
    </tr>
    </form>
    </table>

    As you may already know, ColdFusion code runs on the server.
    It's not sent out to the web browser. It sends out HTML to the
    browser. And what you want to do here is regonize a change that
    occurs in the web browser without submitting the form. The way you
    can do this is AJAX. If you haven't already done so, check out the
    ColdFusion / AJAX library here :
    http://ajaxcfc.riaforge.org/.
    This will give you a good framework of code to use to do this so
    you won't have to reinvent the wheel.

  • How do I tell if a radio button is selected?

    Apart from relying on the radiohandler, is there any direct command or code which i can use to immediately check if a particular radio button is selected or not?
    Like in Visual Basic, we can immediate state if (radiobutton.value = false)
    is there any equivalent to this in java?

    The radio button inherits from abstractButton class.
    I believe in the abstractButton has isSelected method.
    You can use this to get the state of the button.

  • Problem with Radio Buttons: At Selection-Screen

    Hi,
    i have two radio-buttons in my screen with coding
    PARAMETERS:
                      ST RADIOBUTTON GROUP rad1 DEFAULT 'X',         "stock transport
                      PR RADIOBUTTON GROUP rad1.                     "purchase return
    at selection-screen output.
    if PR = 'X'.
    perform f_selection_request_po_ret.
    endif.
    if ST = 'X'.
    perform f_selection_request_stck_trans.
    endif.
    at selection-screen on value-request for s_ebeln-low.
    perform f_f4_values.
    at selection-screen on value-request for s_ebeln-high.
    perform f_f4_values.
    I need to provide different values in drop-down of select-options according to the radio-button selected.
    Like if PR is selected s_ebeln-low and s_ebeln-high displayed will be different.
    and if ST is selected s_ebeln-low and s_ebeln-high displayed will be different.
    My problem is that the program is taking the values of that radio button which is set to Default. While running the program, if I click on the other radio-button, it is showing the same values, not different.
    Kindly, tell me where I am going wrong in the coding.
    Regards,
    Priyanka.

    Hi,
    For this requirement you have to use the following FM's
    <b>DYNP_VALUES_READ </b>  and DYNP_VALUES_UPDATE
    The one highlighted is the one you need to call in the selection screen events to get the values. Do a where used list on this FM and see how its being used.
      DATA : W_REPID    LIKE D020S-PROG,
             W_DYNNR    LIKE D020S-DNUM,
             I_DYNPREAD LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.
      REFRESH: I_DYNPREAD.
      CLEAR  : I_DYNPREAD,
               W_FILE    .
      I_DYNPREAD-FIELDNAME = C_UXPATH.
      APPEND   I_DYNPREAD.
      CLEAR  : I_DYNPREAD.
      W_REPID = SY-REPID.
      W_DYNNR = C_1000.
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                DYNAME               = W_REPID
                DYNUMB               = W_DYNNR
           TABLES
                DYNPFIELDS           = I_DYNPREAD
           EXCEPTIONS
                INVALID_ABAPWORKAREA = 1
                INVALID_DYNPROFIELD  = 2
                INVALID_DYNPRONAME   = 3
                INVALID_DYNPRONUMMER = 4
                INVALID_REQUEST      = 5
                NO_FIELDDESCRIPTION  = 6
                INVALID_PARAMETER    = 7
                UNDEFIND_ERROR       = 8
                DOUBLE_CONVERSION    = 9
                OTHERS               = 10.
      IF SY-SUBRC EQ 0.
    Successfully read screen. GET the values
        LOOP AT I_DYNPREAD.
          CASE I_DYNPREAD-FIELDNAME.
            WHEN C_UXPATH .
              W_FILE   = I_DYNPREAD-FIELDVALUE.
          ENDCASE.
        ENDLOOP.                "LOOP AT i_dynpread.
      ENDIF.                    "IF sy-subrc EQ 0.
    Cheers
    VJ
    Message was edited by:
            Vijayendra  Rao

  • Regarding radio button and selection screen

    hi
    i have a requirement to grey out one particular select option , if any one of 4 radio button is selected. (total 5 radio buttons ) . 
    how do i proceed .
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE  text-001.
    SELECT-OPTIONS: p_year  for  s021-spmon obligatory,
                    p_kunag  FOR vbrk-kunag  ,
                    p_matnr  FOR vbrp-matnr  ,
                    p_augru  FOR vbrp-augru_auft  ,
                    p_vbeln  FOR vbrk-vbeln  .
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE  text-002.
    PARAMETERS: nrw RADIOBUTTON GROUP g1 default 'X'user-command check,
                mwd RADIOBUTTON GROUP g1user-command check,
                rws RADIOBUTTON GROUP g1user-command check,
                edu RADIOBUTTON GROUP g1user command check
                standard RADIOBUTTON GROUP g1 .
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    i know we need to use at-selection screen output.
    but how do i set ONLY that particular select option , to no input.

    Hi ,
    Use like This
    User Dynamic Selection
    at selection-screen output.
      select single * from t000md.
      loop at screen.
        case screen-group1.
          when 'REL'.
            if not  p_old is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'BEL'.
            if not p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'ARB'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'MTA'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
        endcase.
      endloop.
    Reward Points if it is useful
    Thanks
    Seshu

  • How to handle event when the user closing the browser (Urgent Please)

    Hi,
    How to handle the event when user closes the browser....
    i want to display some alter message when user trying to close the browser...
    Please can any one help me how i have to do this...........
    Thanks.

    Finally got this working. You cannot use the stop() or destroy methods. By the time they are called all database connections are gone and you will get a null pointer exception.
    You will have to use the onBeforeUnload method in the html file that calls the applet and use JavaScript to call the save method in java which saves the document:
    <SCRIPT LANGUAGE="JScript" TYPE="text/javascript">
    function Save()
    //i call the applets doSave() method from here in which i save all
    //changes to the database
    top.Tree.document.TestApplet.doSave();
    //this will invoke the default IE message for closing the window
    //when user clicks on the x in the browser
    message = "Your document has been saved."
    return message;
    window.onbeforeunload=Save;
    </SCRIPT>
    //the applets doSave()
    public void doSave()
    //this frame provides user with the message that document is being
    //saved
    final JFrame frame = new JFrame("Saving");
    JPanel contentPane = new JPanel();
    JLabel label = new JLabel(" Please wait, saving document...");
    frame.getContentPane().add(label,BorderLayout.CENTER);
    frame.setSize(250, 100);
    frame.setLocation(300, 400);
    frame.setResizable(false);
    frame.setVisible(true);
    frame.addWindowListener(new WindowAdapter()
    //the frame is just for user's information, so prevent user from
    //closing it or iconifying it.
    public void windowClosing(WindowEvent e)
    frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    public void windowIconified(WindowEvent e)
    frame.setState(frame.NORMAL);
    //call my saveDocument() method that saves everything to the database.
    editorModule.saveDocument();
    //System.out.println("finished calling saving document");
    //once the saving is done the frame with the message disappears
    frame.setVisible(false);
    //System.out.println("setting frame to false");
    //I also had an exit button in my applet, that would perform the same task, however now with the above onBeforeUnload method, the exit message would appear twice, so had to modify my exit button action performed, so that if the exitbutton was clicked the onbeforeunload method would get passed a null value and not do anything.
    private void exitButton_actionPerformed()
    if (DEBUG) System.out.println("Calling exit");
    doSave();
    window.eval("this.onbeforeunload=null;");
    window.eval("top.close();");
    //continue from here if user cancels the closing of the window
    window.eval("this.onbeforeunload=doSave;");
    window.eval("top.focus()");
    window.eval("document.TestApplet.requestFocus()");
    homePanel.requestFocus();
    }

  • How to handle Event when more that 2 rows are selected in a WD Table

    Hello WD developers,
    I need your assistance.
    My case is as following:
    I have a WD table populated with data.
    I also have several buttons in the toolbar table.
    One of those buttons should be enabled only in case that one row (and only one)
    is selected in the table otherwise it should be disable.
    The problem is that an even is triggered only when the first row is selected
    and when the second (third....) are selected no event occur.
    Do you have any idea How can I solve this issue.
    Thnaks in advance for your help.
    Regards
    Harry

    Hi,
    In the Onlead selection of table make it visible and invisble of your buttons as per your selection.
    The table have single selection and multi seletion options are availble when you defing the table you can find this options in the properties of the table.
    In onlead selection your button to be mapped with attribute WDVisble.
    And based on your selection you can visible and invisible.
    wdContext.currentContextElement.set<attribute>(WDVisble.Visble);
    and
    wdContext.currentContextElement.set<attribute>(WDVisble.NONE);
    This might helps you.
    Do you need more post your issues.
    Thanks,
    Lohi

  • How to handle event structures for two buttons and two counters.

         *I have two buttons A and B, and have to compare the difference in hits between them.  So do I place an event structure within a while loop for each button (2 buttons, 2 event structures, 2 while loops), or does it need to be one event structure with cases for both buttons whithin one while loop? 
         *How do I pass the values of buttons A and B's hit counters out of the while loop in order to calculate the differences between them after each increment, not just the final count after the stop button is hit? 
         *How would I make one stop button work to handle both buttons A and B?   I tried to place the actual stop button in one button A's structure and its global in B's structure, but It wont seem to let me use a local variable for a latchable control
    Checker

    You should probably have not started a new thread and waited until your question in the original thread was answered. You can modify altenbach's example for a second button. You have a single event structure with a new event for the second button. You have a second shift register to track the number of times the second button is pressed. Inside the while loop but outside the event structure, you just have a subtract function in or to report the difference. do not modify the posted example for the stop button. It works perfectly as is.

  • Radio button on selection screen event issue.

    Hi all,
    I have two radio buttons and two input mandatory fields on selection screen.
    - If  first radio button selected then some value 'ABC' should fill in second input field.(because it is a mandatory field)
    - If  second radio button selected then some value 'XYZ' should fill in first input field..(because it is a mandatory field)
    If suppose, user deletes first input value (ABC) and selects second Radio then, ABC to automatically display on first input field as this is mandatory. Same like,If he deletes second input field value and selects first radio, it should display XYZ in second input field. (As these fields are mandatory and requires some value).
    I tried with below code, but not working. Appreciate your quick response.
    PARAMETER          ppart RADIOBUTTON GROUP src  DEFAULT 'X'.
    SELECT-OPTIONS  p_sndprn FOR edoc_stat-sndprn OBLIGATORY DEFAULT 'ABC'.
    PARAMETER         psndr RADIOBUTTON GROUP src.
    SELECT-OPTIONS p_sendid FOR zabc-sndlad OBLIGATORY DEFAULT 'XYZ'.   
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP src.
    IF SSCRFIELDS-UCOMM = 'PRGP'.
      IF ppart EQ 'X'.
           P_SENDID-LOW = 'XYZ'.
      ELSE.
          P_SNDPRN-LOW = 'ABC'.
      ENDIF.
    ENDIF.
    Thanks,
    Ranjith.

    Search the forum... don't make fields obligatory and use event AT SELECTION-SCREEN OUTPUT.

  • To make a push button invisible when a Radio button is selected.

    Hi,
         There are 5 radio buttons in a group. Out of those when st and 3rd are selected a push button should be made visible else invisible.
        The problem is that when the transaction is executed by default the first radio button will be selected but the push button wont be visible.But if i re-select the 1st radio button then the push button will be visible.
        So is there any way to make the push button visible when the transaction is executed(ie bcoz the 1st radio button is by default selected) or neither of the radio buttons should be selected by default.
    Thanks in advance.

    Hi Sridhar,
    For example say your PF sataus name is 'STATUS-100'  which contains the push button and function code for the button in 'PUSH', then in your part of code use the following syntax,
    Here 'rb_select' is your radio button.
    IF rb_select EQ 'X'.
        SET PF-STATUS 'STATUS-100' EXCLUDING 'PUSH'.
    ENDIF
    I hope this will help you.
    Regards,
    Manoj Kumar P
    Edited by: Manoj Kumar on Dec 15, 2008 12:03 PM
    Edited by: Manoj Kumar on Dec 15, 2008 12:03 PM

  • Radio button and selection screen

    hi
    my requirement is that if the user enters some particular combination of value in the select options and clicks a particular radio button there should be an error message displayed.
    1)  I am getting the error message in the form a dialog box , but it has only option of  exit , and the user is thrown of the screen. my requirement is that after the error message the user must still be at the same screen so that he can enter new values.
    2)  the code that i have written also has one more anamoly that the displaying of error depends upon the sequence of  actions .
      if  i enter the value in the select option first and then click the radio button then the error message is displayed which is correct.
    but it doesnt work i click the radio button first and then enter the value, the program is executed and NO ERROR message is flashed.
    here is what i have written
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE  text-001.
    SELECT-OPTIONS: p_year  for  s021-spmon obligatory ,
                    p_kunag  FOR vbrk-kunag  ,
                    p_matnr  FOR vbrp-matnr  ,
                    p_augru  FOR vbrp-augru_auft modif id a1 ,
                    p_vbeln  FOR vbrk-vbeln  .
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE  text-002.
    PARAMETERS:  nrw RADIOBUTTON GROUP g1 user-command check,
                 mwd RADIOBUTTON GROUP g1 ,
                 rws RADIOBUTTON GROUP g1 ,
              edu RADIOBUTTON GROUP g1 ,
             standard RADIOBUTTON GROUP g1 default 'X' .
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    at selection-screen output.
       loop at screen.
       if nrw = 'X' and p_augru-low EQ 'MWD'.
           MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.
    endif.
       endloop.
    START-OF-SELECTION.
    CASE 'X'.
    WHEN nrw.
    PERFORM set_dates_nrw.
          PERFORM load_data_nrw.
          PERFORM get_cust_info_nrw.
          PERFORM set_alv_field_cat_nrw.
          PERFORM display_alv_nrw.
    endcase.

    Hi
    Change this piece of code
    at selection-screen output.
    loop at screen.
    if nrw = 'X' and p_augru-low EQ 'MWD'.
    MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.
    endif.
    endloop.
    by
    <b>at selection-screen.
    if nrw = 'X' and p_augru-low EQ 'MWD'.
    MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.
    endif.</b>
    Reward points if useful.
    Regards,
    Atish

  • HR-ABAP: Defaulting Radio Button on Selection Screen of PNP LDB

    Hi all,
    I am using PNP LDB (Logical Database) for program which is used for Payroll Results.
    Now I have a requirement wherein it is necessary to select 'Up to today' as default on the selection screen.
    We are having 4.7C version of SAP. I tried following code in INITIALIZATION event:
    Initializing Selection Screen Data Selection Option to 'Up To Today'
    INITIALIZATION:
      MOVE:  'X'    TO    pnptimr4, " This is the option which I want as Default selection.
             space  TO    pnptimr1,
             space  TO    pnptimr2,
             space  TO    pnptimr3,
             space  TO    pnptimr5,
             space  TO    pnptimr6.
    But still I dont see this Radiobutton getting selected as Default selection while running the program.
    By Default it selects Option : 'Other Period' (pnptimr6).
    Any Idea how to resolve this ??
    Regards,
    Avinash

    hi...
    When the INITIALIZATION event occurs, you can set default values for the selection screen.
    The fields for the data selection are defined in structure QPPNP.
    Possible values for field PNPTIMED are:
    D     =      Today (key date)
    M     =     Current month
    Y     =     Current year
    P     =     To current date
    F     =     From today (from current date)
    The person selection fields are defined in include program DBPNPSEL. They are internal tables that must be filled using APPEND.
    so in intialization you have to write code as
    PNPTIMED : P.
    so up date will be defaulted in selection screen.
    award points if helpful.

Maybe you are looking for