How to disable a field on the basis radio button value selected.

hello to all,
i am facing one problem.I have declared two selection screen blocks.
In one i hvae declared two radio button r1 -Fiscal year and r2--Datewise.
And in another selection screen block all i/p fields. like plant. date.year etc.
Now if user select r1-Fiscal year  then i/p field - date of second block should be disable.
And if user select r2-Datewise  then i/p field - year of second block should be disable.
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME
          TITLE TEXT-002.
       PARAMETERS: R1 RADIOBUTTON GROUP RA1 user-command ucomm,
                   R2 RADIOBUTTON GROUP RA1 DEFAULT 'X'.
   SELECTION-SCREEN END OF BLOCK  BLK.
selection-screen begin of block b1 with
  frame title text-001.
parameters : gjahr like ZSA_DETAIL-gjahr  MODIF ID YAR,
             aedat like ZSA_DETAIL-aedat  MODIF ID DAT,
             werks like ZSA_DETAIL-werks .
selection-screen end of block b1.
AT SELECTION-SCREEN on RADIOBUTTON GROUP RA1.
   BREAK-POINT.
    IF R1 = 'X'. "fiscal
     LOOP AT SCREEN.
        IF screen-group1 = 'DAT'.
         screen-active = 0.
         screen-invisible = 1.
         MODIFY SCREEN.
         ENDIF.
        endloop.
   ELSEIF R2 = 'X'.
     LOOP AT SCREEN.
     IF screen-group1 = 'YAR'.
       screen-active = 0.
      MODIFY SCREEN.
     ENDIF.
     ENDLOOP.
    ENDIF.

Hi Shikha,
Regarding your query, when you select a particular radio-button then the fields pertaining to that radio-button should get activated or get displayed, otherwise it should be hidden.
This can be done adding the addition to the Radiobutton 'USER-COMMAND' this will automatically enable-up
the functionality of the fields related to that radiobutton, while disabling the others.
If USER-COMMAND isn't given, then ENTER key serves the purpose.
DATA:
w_carrid LIKE sflight-carrid,
w_connid LIKE sflight-connid.
PARAMETERS:
p_carrid RADIOBUTTON GROUP airl USER-COMMAND airline,
p_connid RADIOBUTTON GROUP airl.
SELECT-OPTIONS:
s_carrid FOR w_carrid,
s_connid FOR w_connid.
INITIALIZATION.
p_carrid = 'X'.
Now enabling desired fields and disabling the others, can be done by the following snippet.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_carrid EQ 'X'.
IF screen-name CS 'S_CONNID'.
screen-active = 0. " Disable the field S_CONNID
MODIFY SCREEN.
ELSEIF screen-name CS 'S_CARRID'.
screen-active = 1. " Enable the field S_CARRID
MODIFY SCREEN.
ENDIF.
ELSEIF p_connid EQ 'X'.
IF screen-name CS 'S_CARRID'.
screen-active = 0.
MODIFY SCREEN.
ELSEIF screen-name CS 'S_CONNID'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
Hope, this would help you solve your problem.
Thankyou,
Zahack.

Similar Messages

  • How to make some fields mandatory based on radio button selected

    Hi,
    As per requirement i have two radio buttons in my screen.
    1.update
    2.Display.
    When the user clicks update then certain fields of selection screen should be made mandatory.
    And if the user cliks the Display Radio Button then certain fields should be made mandatory.
    How to code for it.
    Thanks and Regards,
    Smriti

    Hi ,
    use this code ,
    now according to your requirement you make changes to your parameters.
    parameters: r1 as radiobutton group g1, " this id you update button
                r2 as radiobutton group g1.         " this is for display
    PARAMETERS: TEST1(10) MODIF ID SC1, " assume these are the fields as parameters.
    TEST2(10) MODIF ID SC2,
    TEST3(10) MODIF ID SC1,
    TEST4(10) MODIF ID SC2.
    AT SELECTION-SCREEN OUTPUT.
    if g1 = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'SC1'.
        SCREEN-INTENSIFIED = '1'.
        MODIFY SCREEN.
        CONTINUE.
      ENDIF.
      IF SCREEN-GROUP1 = 'SC2'.
        SCREEN-INTENSIFIED = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    elseif g2 = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'SC1'.
        SCREEN-INTENSIFIED = '1'.
        MODIFY SCREEN.
        CONTINUE.
      ENDIF.
      IF SCREEN-GROUP1 = 'SC2'.
        SCREEN-INTENSIFIED = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    Please let me know if you still need any help.
    Thanks and regards,
    Rajeshwar

  • How to disable a field in the table maintenance generator of a table

    dear experts,
    i have created a table with  2 fields A ,B . i had created table maintenance generator  for the table. i am entering the values for the table through table maintenance generator . for filed A i had given dropdown list which contains  only 2
    entries YES & NO. my requirement is if i select YES in field A , field B should be in enable mode(it must take some input), if i select NO in field A, field B should be in disable mode ( it should not take any input).
    kindly help me....
    thanks & regards
    krishna

    Hi Krishna,
    A further to the above, you can go to SE11 and in the table maintenance generator click on
    Fn.Gr.Text button, then go to Main program.
    Here you will see "User-defined Include-files (if necessary). "
    Just uncomment the PAI include and put your code..to make the field editable or un-editable.
    To do that you might have to go to the screen painter and change that screen, to include those fields in a group or something, so that you can control them better.
    Regards,
    Sameer

  • How to disable all fields of a page on button click

    Hello, I am using JDeveloper 11.1.2.3.0
    I have a page with several fields on it. I want to have all the page fields disabled when I click a certain Button. How can I achieve this?
    If what I am asking is too difficult to achieve can you help me with an idea on how to achieve something similar?
    Thank you

    This can be achieved by using JavaScript Client API get the id's all the fields while clicking the button  and disable your Components,
    Calling Backing bean method or binded component involves server side round-trip, you can easily achieve this using simple java script in
    Client Side..
    Call this method in your Client Listener ..
    function disableFields(actionEvent) {
            var field1= AdfPage.PAGE.findComponent("field1id");
            var field2 = AdfPage.PAGE.findComponent("field2id");
            field1.setDisabled(true);
            fileld2.setDisabled(true);

  • Please solve  Radio buttons (when selected) will then display on the report

    Each of these new Radio buttons (when selected) will then display on the report in the same locations, which is after the existing columns.
    Check boxes are by default checked.
    When the 1st radio button is selected then a new column will be displayed in the ALV output
    Next to A.
    Like wise when 2nd radio button selected then a new column will be displayed in the ALV output next to B.
    Like wise the ALV output is displayed.
    A   is a checkbox
    B  is a checkbox
    C   is a checkbox
    D   is a checkbox
    1   is a radio button                         
    2   is a radio button      
    3  is a radio button
    4   is a radio button

    while populating fieldcatalog itself u include these condition....
    if Pradiobutton = 'X'.
    *--populate field catalog for field u want in specified position....
    endif.
    similarly u proceed for other fields and other condition

  • How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?

    How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?
    I’m creating a form where the user has three options to make a payment.
    1. charge to my credit card
    2. charge associated costs to bank account
    3. By cheque or money order
    My Problem is, under each option, there are required fields that has to be filled out. So if the user picks the first option, charge to my credit card, they would fill out the required fields (credit card number, expiration date etc.). But when they click submit button to submit the form, it won’t let them, because there are required fields under the second option. Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it. So what I'm trying to do is this: If the user selects the radio button for option 1, the other two options are greyed out/disabled. And if the user holds down the shift key and clicks radio button for option one again, it unchecks the radio button and the other two options are available again. Is there a way to grey out or disable the two other payment options when the other one is picked. I’m assuming I will have to use javascript, but what would the coding be and which field do I write it under?
    Thanks in advance guys

    You will have to use custom JavaScript to access the various properties of the field object.
    The radio button group has a value. When no button is selected that value is "Off". When an individual button has been selected the value for the group will be the option or export value for that individual button.
    Once you have determined the button selected, then you will know the form fields that need to be made required. You use JavaScript to access those fields and change the "read only" property to false, and set the "required" property to true. For the fields associated with the other options, those fields should be reset, made read only, and have the "required" property set to false.
    Disabling (graying-out) Form Fields
    >> Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it.
    Radio button in a PDF do not work that way. Only check boxes can be unchecked by clicking on one that has been checked.
    If you plan the coding for the Mouse UP action to test for all possible options and code for each of those options you should have what you want.
    If you want actual code you need to provide a lot more details.
    It is even possible to perform some credit card and bank routing number validations with JavaScript and some check digit formulas.

  • Disable certain fields during the creation of SC using "create limit item"

    Hi,
    I have a requirement to disable certain fields from the role "SHOP" associated with the operational purchaser role. I would like to disable the fields "Unlimited check box", "Service Agent", " Invoice Only radio button", "Unknown account assignment radio button" from the screen I get during creation of SC using the option "Create Limit Item". Also i need to disable the option "Good / Service" entry box as we are using only free text items and donu2019t want this option to be seen in the screen when using the operational purchaser role.
    Please advise how can I achieve this.
    Regards
    GGL

    Hi,
    I have a same requirement to disable certain fields from the Shopping Cart Limit Item. I would like to disable the fields  "Service Agent", "Unknown account assignment radio button" from the Detail  screen. during creation of SC using the option  Limit Item .  Also i need to make default Value "Known" and "Invoice Only". But this is in SRM 7.0. Notes You have mentioned supports only Release 5.5, But I am in Release 7.0. Any idea?
    I appreciate your help
    Thanks,
    Monica

  • How to add new fields to the system form (Ex.expenses to a/r invoice form)

    hi
    can any one tell me how to add new fields to the system form (Ex.expenses to a/r invoice form)
    i want to add expenses field to system a/r invoice form and connect data base also.
    i used the code of samples\11.system form manipulation(vb.net) but i'm not able to get it....so can any one help with code or concepts.
    reply soon plz..
    thankQ

    If I understood you correctly, you are just trying to add new fields to the invoice form and then use them in your form. you should first go and add the field to your tables, which you would do by going to Tool --> User Defined Fields --> Manage User Fields. There are different documents or categories given. For ex. for invoices, Sales Orders you would add your field under the Marketing Documents. If you want the field to be just one per invoice, add it to the Title, otherwise if you want a field per invoice or Sales Order line, add it to the Rows section. Once you have done that then you can just create a edit box or drop down to represent the field and set the datasource for that to your field. If you want example code to do that, let me know.

  • How to check radio button as default on the basis of database value?

    Hi Friends,
    I have one jsp, in which I am having a field of radio button, which have two boolean values of 0 & 1. I want to check the radio button as default on the basis of database value, kindly help me out.
    Thanks a lot in advance. Please help me out.

    probably, when using struts you should do all your calculations in action class it self
    Eg. in jsp
    <html:radio name="myForm" property="myProperty" value="0">0</html:radio>
    <html:radio name="myForm" property="myProperty" value="1">1</html:radio>
    in Action class
    if (databaseValue == 0)myForm.setMyProperty(0);
    else if (databaseValue == 1)myForm.setMyProperty(1);
    rest will follow
    whatever be the value it will come selected

  • CRM  IC Winclient - How to add new fields in the BP Search of TRX CIC0

    Hello Experts,
    I want to know how to add new fields in the BP Search of TRX CIC0. In the HTML that we're using here I need to add the URL of the BP.
    Can you help me?
    Thanks in advance.
    Caíque Escaler

    Hi
    make append to tables in se11 - CCMBP1FIELDS, CCMBP2FIELDS
    in spro in Define customer-specific search control -> mark fields with X.
    and enhance html template CRM_CIC_SEARCH_DISPLAY. -> tcode smw0, look for package CRM_CIC_COMPONENTS for html CRM_CIC_SEARCH_DISPLAY. export it from SAP, edit, and import.
    you will need to enhance function module used for searching - you will find him in spro in Search Strategies.
    Regards
    Radek

  • How to update ABSKZ field in the table EKPO

    Hi
    Is there any way to update the rejection indicator (ABSKZ) field of table EKPO?.
    I am looking at BAPI_CHANGE_PO FM, But it does not have ABSKZ field in the item structure BAPIMEPOITEM.
    Do I need to extend the BAPI structure with ABSKZ field ?
    Regards
    Raj.

    Hi
    To extend  BAPI_PO_CHANGE  for EKPO-ABSKZ field , we have to add field in the structure BAPI_TE_MEPOITEM to pass it to  EXTENSIONIN. As ABSKZ field already availble in the EKPO it is not allowed to add ABSKZ in the structure BAPI_TE_MEPOITEM. it is throwing below error message.
    Field ABSKZ in table EKPO is specified twice. Please check
    Since it is not Z field and also not availble in the structure BAPIMEPOITEM  not sure how to update ABSKZ field in the EKPO table.
    Please advice.
    Regards
    Raj

  • How to validate input fields as the user is filling up a form with jQuery?

    Hello EA friends.
    Someone has experimented on how to validate input fields as the user is filling up a form with jQuery?, if the field is numeric and insert an A for example, an alert appears showing "insert a number" or not allowed to enter anything until a number is entered.
    Thanks and regards.
    Fer

    Hi Sudeshna.
    Sorry for not responding on time, how can I be included in this code?
    sym.setVariable("typeActivity", "input")
    var Element_1=document.createElement(typeActivity);
    $(Element_1).css({"text-align": "center"});
    //Answer
    sym.setVariable("Answer_1", "4");
    sym.$("box_1").append(Element_1)
    This code is on my creationComplete and it works fine.
    Would greatly appreciate your help.
    Regards.
    Fer García

  • How to Add IBAN Field in the Bank Details Infotype?

    Hello All,
    I need to know the procedure for How to add IBAN field in the bank details infotype?
    Could anyone help me please.
    I m new to SAP HR.
    Immediate help will be appreciated.
    Thanks.
    Regards,
    Mudassir.Imtiaz

    Hi mudassir,
    For IBAN implementation:
    1. Implement SAP Notes 925410, 1409674, 1405521
    2. Go to t-code FIBF - From menu select Settings - P/S Modules - of an SAP Application - Create entry
    For Turkey we've added the following entry (depends on country) :
    00003040 TR CONVERT_IBAN_2_BANK_ACCOUNT_TR
    3. Go to V_T588M for module pool MP000900 and screen 2000 select IBAN & Q0009-IBAN00 fields as standard.
    4. Go to table T77S0 and make value of ADMIN IBAN entry S.
    Regards,
    Dilek

  • How to disable amount field in me21n/me22n

    Hi all,
    In me22n how to disable amount field in condition tab based on condition type.
    Regards
    suni

    Hi,  check SPRO

  • How to disable individual field of a search view

    Hi All,
    Is there a way to disable individual search field of an advance search view ?
    The reason for this is that for a particular search field I am defaulting the value and do not want the user to be able to change this default value, in effect filtering out their search.
    I have tried get_i method but the advance search (thtmlb:advancedSearch) does not seem to trigger the get i method, disabled just disable every fields likewise the global edit/viewgroup context.
    Thanks in advance for your assistance.
    Edited by: ANDREW NGUYEN on May 12, 2010 10:45 AM

    Hi,
    I checked it now and found that the GET_I_FIELD is not getting triggered. Sorry for my wrong solution.
    You can use the rt_result parameter in GET_POSSIBLE_FIELDS method in IMPL class.
    It returns the search fields visible in the view.
    Regards,
    Arun Kumar
    Edited by: Arun Kumar on May 12, 2010 11:35 AM
    Edited by: Arun Kumar on May 12, 2010 11:38 AM

Maybe you are looking for