How to disable a field in selection screen based on condition.

Hi,
I have 2 radio buttons- p_normd, p_recov  and 2 other controls - like text boxes, say tb1 and tb2. and some mandatory fields below.
If i choose p_normd, i want one control(tb2) to be disabled and if i choose p_recov, i want the other control(tb1) to be disabled(tb2 should be enabled then.)
Currently i am using the following code. The 1'st radiobutton is intially checked. But the problem is when i click on the 2'nd radio button, the other control(tb1) is not getting disabled. When i double click, i get an error telling mandatory field to be filled. Only after the other mandatory fields below are filled, and after i double click on the unchecked radiobutton, the other control gets disabled.
Please suggest what to do..
The current code below:
  AT SELECTION-SCREEN OUTPUT. "ON RADIOBUTTON GROUP rg01.
  LOOP AT SCREEN.
  IF  p_normd EQ c_x  AND screen-group1 = 'SC2'.
        MOVE 0 TO screen-input.
      MODIFY SCREEN.
  ENDIF.
  IF p_recov EQ c_x AND screen-group1 = 'SC1'. "IF screen-name = 'ERDAT-LOW' OR screen-name = 'ERDAT-HIGH'.
        MOVE 0 TO screen-input.
        MODIFY SCREEN.
  ENDIF.
  ENDLOOP.
Thanks,
Ammu

Hi
declare your parameter as below:
parameters: p_x type c radio button group g1 user-command r.
in at selection screen output event .
check for the radio button.
loop at screen.
if screen group is <desired value>
then screen-active = 0 or 1. <do whatever you want to do.>
modify screen.
endloop.
see below the sample code.
<<<<<AT SELECTION SCREEN EVENT>>>>>
AT SELECTION-SCREEN ON BLOCK B1.
  IF P_LCOST = C_X.
    PERFORM CLEAR_FIELDS.    " Clearing fields before loading the screen
    CALL SELECTION-SCREEN 100 STARTING AT 20 5.
  ELSEIF  P_MCOST = C_X.
    PERFORM CLEAR_FIELDS1.          " Clearing fields before loading the screen
    CALL SELECTION-SCREEN 101 STARTING AT 20 5.
  ENDIF.
  IF SY-SUBRC = 0.
    PERFORM VALIDATION.             " Validating selection screen input
  ELSE.
    LEAVE TO TRANSACTION C_TRAN.
  ENDIF.
<<<<<<DECLARATION PART>>>>>>
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_LCOST RADIOBUTTON GROUP GI DEFAULT 'X',
            P_MCOST RADIOBUTTON GROUP GI.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS WINDOW TITLE TEXT-002.
SELECTION-SCREEN BEGIN OF BLOCK B2.
PARAMETERS: P_COAREA TYPE CSKS-KOKRS OBLIGATORY,         " controlling area
            P_FYR    TYPE COEP-GJAHR OBLIGATORY,         " fiscal year
            P_PERIOD TYPE COEP-PERIO OBLIGATORY.         " fiscal period
SELECT-OPTIONS: S_CCNTR FOR V_KOSTL OBLIGATORY,       " Cost Center
                S_COELM FOR V_KSTAR MODIF ID M1,       " Cost element
                S_PDATE FOR V_BUDAT OBLIGATORY.       " posting date.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN END OF SCREEN 100.
SELECTION-SCREEN BEGIN OF SCREEN 101 AS WINDOW TITLE TEXT-003.
SELECTION-SCREEN BEGIN OF BLOCK B3.
PARAMETERS:     P_CCODE  TYPE T001-BUKRS OBLIGATORY,         " Company Code
                P_FYEAR  TYPE COEP-GJAHR OBLIGATORY.         " fiscal year
SELECT-OPTIONS:   S_GLACC FOR V_HKONT OBLIGATORY,       " G/L Account
                  S_PCNTR FOR V_PRCTR MODIF ID M2,      " Profit Center
                  S_PODATE FOR V_BUDAT OBLIGATORY.      " posting date.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN END OF SCREEN 101.
thanks
LG
Edited by: LalitG on Apr 13, 2011 1:38 PM

Similar Messages

  • Display input field on selection screen based on condition

    Hi,
    I have a report with selection with no of  input fields and a checkbox .I want to hide  few i/p fileds based on checkbox i/p.
    If the checkbox = 'X',then only those fields should apper on screen for input.
    how do we get this on sel screen.
    thanks in advance.

    Hi,
    you can use this code as reference.
    Here, depens on check box, in the next screen resepective select options will be displayed.
    You can use this logic for your requirement.
    REPORT Z50871_SELECTOPS_DYNAMIC.
    PARAMETERS : CH_EBELN AS CHECKBOX,
    CH_VBELN AS CHECKBOX.
    DATA: V_EBELN TYPE EKKO-EBELN,
    V_VBELN TYPE VBAK-VBELN.
    SELECTION-SCREEN BEGIN OF SCREEN 100.
    SELECT-OPTIONS : EBELN FOR V_EBELN MODIF ID G1,
    VBELN FOR V_VBELN MODIF ID G2.
    SELECTION-SCREEN END OF SCREEN 100 .
    AT SELECTION-SCREEN OUTPUT.
    IF SY-DYNNR = 100.
    IF CH_EBELN = 'X' AND
    CH_VBELN = ''.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 EQ 'G1'.
    SCREEN-ACTIVE = '1'.
    ELSE.
    SCREEN-ACTIVE = '0'.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ELSEIF CH_VBELN = 'X' AND
    CH_EBELN = '' .
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 EQ 'G2'.
    SCREEN-ACTIVE = '1'.
    ELSE.
    SCREEN-ACTIVE = '0'.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ELSEIF CH_EBELN = 'X' AND CH_VBELN = 'X'.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 EQ 'G1'
    OR SCREEN-GROUP1 EQ 'G2' .
    SCREEN-ACTIVE = '1'.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ENDIF.
    ENDIF.
    AT SELECTION-SCREEN.
    IF SY-DYNNR = 1000.
    IF CH_EBELN = 'X' OR CH_VBELN = 'X'.
    CALL SELECTION-SCREEN 100.
    ELSE.
    MESSAGE I000(Z50871MSG) WITH 'Please select atleast one checkbox'.
    ENDIF.
    ENDIF.
    Regards
    Sandeep Reddy

  • How to disable save button on selection screen (1000) run from other report

    Hi Experts,
    Can any one let me know how to disable save button on selection screen (1000) run from other report.
    Say I am running from report R1 which submits report R2, but the save button should be disabled on
    report R2(selection screen 100).
    Thanks in advance.
    Regards
    RP.

    Hi RPReddy16 ,
    Try this:
    DATA :BEGIN OF t_extab occurs 0,
                     fcode like rsmpe-func,
                 END OF t_extab.
    REFRESH T_EXTAB.
    MOVE 'SAVE' TO T_EXTAB-FCODE.
    APPEND T_EXTAB.
    CLEAR T_EXTAB.
    SET PF-STATUS 'STATUS' EXCLUDING T_EXTAB.
    Regards,
    José

  • How to make a field in selection screen as READ_ONLY !!

    Hi,
       How to make a field in selection screen as READ_ONLY !!.
    Thanks,
    Senthil

    This is the code you need to have in your program.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
      IF SCREEN-NAME = 'MYSELFLD'.
        SCREEN-INPUT = 0.
        MODIFY-SCREEN.
      ENDIF.
    ENDLOOP.

  • How to hide input fields on selection screen using variant attribute

    Hello all,
    I want to know how to hide input fields on selection screen using variant attribute conpletely.
    As you know, when setting the attribute of variant "Hide field" checked, the field is temporarily hidden, but when clicking "All Selections(F7)" button on the selection screen, the fileds become appeared.
    I want to hide the field completely. Di you know how to do ?
    Thank you for your support.
    Regards,
    Hideki Kozai

    Use this attribute hide field and save the variant. Then create transaction for this program setting default variant for parameter Start with variant . The user who runs it will have it by defualt set.
    Otherwise
    in PBO simply use LOOP at screen and output = 0 for this field. This will ensure that field is invisible in any case.
    Regards
    Marcin

  • How to make required field on selection screen in Query

    i'm now working with query(SQ01).
    but don't know how to make required field on selection screen in Query.
    thanks in advance

    i'm now working with query(SQ01).
    but don't know how to make required field on selection screen in Query.
    thanks in advance

  • Validate a field on selection screen based on value entered on anothr field

    HI,
    There is a program with some fields in selection screen in EWM. The first field is Warehouse. I need to add another field 'Entity to Dispose' in such that what ever value I enter in Warehouse field, its corresponding values should only be displayed as F4 help for 'Entity to Dispose' field.
    For eg: If I select the warehouse as 0799(lets say), then the F4 help for Entity to Dispose field should display only the values which are related to warehouse 0799 (and any other values pertaining to other warehouse should not appear).
    Could anyone suggest, how this can be achieved?
    Thanks in advance.
    Regards,
    Pavan

    Hi,
    You can use FM
    DYNP_VALUES_READ
    DYNP_VALUES_UPDATE
    to read the another field value and Using that field build your internal table for f4 values.
    and use FM F4IF_INT_TABLE_VALUE_REQUEST for F4 values..
    do this on AT SELECTION-SCREEN ON VALUE REQUEST FOR <YOUR_F4_FIELDNAME>.

  • How gray out the fields in selection screen with parameters

    Hi,
    Can any one help me how to gray out the selection screen fields
    Start-of-selection----
    Parameters : p_status TYPE edids-status MODIF ID xyz DEFAULT co_51.
    End-of-selection----
    i want to grayed out the field p_status.
    except At selection-screeen output, can any one suggest the other method of gray out the above field.
    Thank u
    B Ravi Kumar

  • How to validate ch field in selection screen

    hi experts.......
    how to validate ch field selection screen......... and which function module is used to validate parameter field i.e character

    Hello,
                Is your requirement to Validate the Character Field? This is what I understand. If it is right, then do you want to Validate whether a Character Value is entered?
                Check the below Sample Code.
    At Selection-Screen on P_CHARFIELD.
        IF P_CHARFIELD CA '1234567890'.
            Message 'Enter an Alpha Character only' Type 'E'.
        Endif.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

  • How ti disable enter button in selection screen.

    Hi,
    Developed a  report and when execute the Tx code first i get selection screen and when inputs are given in selection screen and hit enter it will direct to module pool screen.. here after giving inputs in selection screen,ENTER and F8 button are working but i want to disable ENTER button ....
    Regards,
    Venkat.

    Hi venkat,
    I am also fasing same problem plz help me how to call form in start-of-selection please help me with any sample as soon as possible,
    Regards
    sridevi.V

  • Disable a field in selection screen

    Hi,
         I have a field in the selection screen and currently i am disabling in the code like:
    loop at screen.
    if screen-name = 'V_GROUP'.
       screen-input = 0.
       modify screen.
    endif.
    endloop.
    my problem is that if i choose a variant and if it has a value for group then it
    overwrites it.
    is there any way where i can avoid it?

    Yes,  I believe that you can check for the variant, then clear it out.  Check against sy-slset.  This will hold the variant name if one is being used.
    report zrich_0003 .
    parameters: p_check type c.
    parameters: p_group type c.
    at selection-screen output.
      loop at screen.
        if screen-name = 'P_GROUP'.
         screen-input = '0'.
          modify screen.
        endif.
      endloop.
    start-of-selection.
      if sy-slset <> space.
        clear p_group.
      endif.
    Regards,
    Rich Heilman

  • How to disable execute button in selection-screen

    Hi,
    I have already placed a execute button in selection screen but now I want to diable
         1. All std  buttons including F8
         2.   but excluding F1
    regards
    paul

    Hi
    Check this FM : RS_SET_SELSCREEN_STATUS
    sample code :
    DATA: BEGIN OF i_exc OCCURS 0,
           code LIKE sy-ucomm,
       END OF i_exc.
      DATA: ws_repid like sy-repid.
      CLEAR i_exc.
      i_exc-code = 'ONLI'.
      APPEND i_exc.
      MOVE: sy-repid TO ws_repid .
      CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
        EXPORTING
          p_status  = ' '
          p_program = ws_repid
        TABLES
          p_exclude = i_exc.
    Laxman
    Message was edited by: Laxmana Kumar

  • To disable  fields on the screen based on condition

    Hello folks,
    Iam doing  one module pool program in that in one screen i need to disable the 3 fields based on the value entered in the 1st field.
    for me its working but  after entering the value in field 1
    I need to press enter key then only it is working.
    is it possible to gray those 3 fields just by entering values and without pressing the enter key.
    any suggestion will be rewarded
    Regards,
    cnu

    Hi,
    It is not possible to gray field without pressing enter  key.
    Because a key is pressed it will trigger an event ..i.e PAI .
    So if we dont press enter .System will not do anything.cause it does not know which event to trigger..
    So we have to press enter
    Best regards,
    Brijesh

  • Transaction DP97: Need to add 2 fields on selection screen...

    Hi,
    I am using ECC6.0. I need to add 2 extra fields on selection screen of transaction DP97. Program name is RVPKMASS97. i did not find any screen-exit for this. Please can anybody suggest any other way to add fields on selection screen... I think i can use enhancement points. please help if anybody has previously worked on this. I need to know following things:
    1) how to add 2 fields on selection screen ( 2 fields are : MATNR-Service product and FFPRF-DIP profile)
    2) where to add programming logic for this
    Thanks in advance,
    Minal

    Hi,
    Go to program RVPKMASS97.
    Go inside INCLUDE rvpkmasspar.
    (When you double click on the include a pop up screen will come up and in that select the RVPKMASS97)
    Click on spiral icon there on the tool bar.
    right click on the '
    ENHANCEMENT-POINT RVPKMASSPAR_01 SPOTS ES_RVPKMASSPAR STATIC INCLUDE BOUND .' line and select enhancement-> create. and give some implementation name and text.
    now you can declare ur fields in this implementation.
    After declaring save it and activate it.
    Now go back to ur txn and run. you are able to see the custom fields on the screen.
    Reward me points if it is helpful.
    I think it will help you out.
    Thanks,
    Prasanna

  • How can i declare a single radio button field in selection-screen ?

    How can i declare a single radio button field in selection-screen ?

    >
    Rob Burbank wrote:
    > And how will you turn it off once it is turned on??
    >
    > Rob
    Thats correct ;)...See ravi if users will ask so many things its our Job to convay the correct solution ....
    Just post your org requirement..SOo some body guide you better//
    Sas

Maybe you are looking for

  • SMB no longer working in 10.4.8???

    I was happily connecting to both my daughters iMac and my husbands Windows PC using SMB.....then it stopped working?! Now obviously something must have happened to change this and I've been thinking what it could be. Well nothing had changed on eithe

  • How to call a function in "matlab script"

    Hellow! I am using Matlab scrip to make some matlab program in Labview,but i find when i try to call a matlab function like"myfun.m",it will ouput error message"undefined command myfun. So what should i do to call function in matlab script? thanks!

  • I tried to connect via to dvi to hdmi and it did not wrk

    if I have vga and dvi on my monitor but only vga on my computer does this mean I dont have compatable computer to run hdmi for my display? This question was solved. View Solution.

  • Row -level based calculations in OBIEE11g - pivot table

    Hi Experts, I have the report with the format.. Where Transaction Amount is my measure and Events is one of the dimension(Event type) and Time is another dimesion (Year & Month columns).. Transaction Amount                                            

  • Will updating macbook software make me lose my files

    I am updating from 10.5.8 to Mac OS X Snow leapard 10.6.3