Changing of default values on the selection screen dynamically

Hi,
      I have 2 radiobuttons R_A & R_B and i have one text field like P_TEXT. Based on selection of radio button i have to change the default values in P_TEXT on the selection screen. like if i select R_A i have to display P_TEXT = 'A'. if i select R_B then it has to display P_TEXT = 'B'. I tried like as below
in AT SELECTION-SCREEN OUPUT EVENT.
             IF R_A = 'X'
               P_TEXT = 'A'.
             ELSEIF R_B= 'B'.
               P_TEXT = 'B'.
             ENDIF.
        But it's not working. it is working only for first radio button. when i select second radio button it is not giving the second value. can any one tell the sol.
Tks in advance.

Hi Pammi,
Use this code, its working:-
PARAMETERS : r_a RADIOBUTTON GROUP gp1 DEFAULT 'X' USER-COMMAND rb,
             r_b RADIOBUTTON GROUP gp1,
             p_text(20).
"we use user command with the radiobutton so that some event is occured in order to call AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
  IF r_a = 'X'.
    p_text = 'Hello'.
  ELSEIF r_b = 'X'.
    p_text = 'Hi'.
  ENDIF.
In the above case 'AT SELECTION-SCREEN OUTPUT' will act as PBO of the selection screen and will change value of selection text as per condition.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir

Similar Messages

  • Default value on the selection screen.

    Hi All,
    We have a field on the selection that is Sales Organisation.
    Now for this field we want the default value coming from the User Parameters.
    i.e On SAP menu under SYSTEM there is User profile, In that user profile if you go to OWN DATA, There is tab called parameters.
    Here VKO Parameter ID the sales Organisation is defined. They want this value to come as default on the screen.
    Please help out how can this be done.

    In the INITIALIZATION write the code as below.
    get paramater id 'VKO' into field p_sfiled.
    here p_field is your selection screen field.
    Reward points if useful
    Regards,
    Nageswar

  • How to display the sort value in the selection screen in the report title

    Dear All,
    How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
    Good day,
    Thanks and regards
    Arun S

    Hi Arun,
    Try this.
    1, Set one dynamic parameter,
    2, Drag and drop that parameter into  your report title.
    3, Pass the value(sort value) dynamically from your application,
    4, Cheers..
    Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then  set the data source from CR designer. and darg and drop that data column into the report.
    Hope this will work,
    Regards,
    Salah
    Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM

  • Retrieve input values from the selection screen

    I have a requirement to retrieve the variable value or values inputed from the selection screen and label the worksheet tab to replace the tab name 'Sheet1' from the Excel. The only way to do this would be to write a macro to label the sheets but how would I retrieve the value(s) from the selection screen criteria? Is the value of the selection screen entered by the user stored in some table? How would I write the macro to retrieve this value?
    For example, I want to retrieve the company code entered from the selection screen and lets say the company code entered as 10; I would want to replace the worksheet from 'Sheet1' to '10' . Texts would be more recognizable.

    Use the option Layout->Display Text Elements->Variables from the BEx toolbar. This will display Variable screen user input on your workbook in a fixed location. Then you can use your macro to name the worksheet with the cell reference.
    Thanks
    Vineet

  • Change de default camera from the lock screen in iOS 5

    Is there a way to Change de default camera from the lock screen in iOS 5?
    There are way better camera apps (camera+) than de default in the lock screen in iOS 5, is there a way to change this?

    No.

  • How to create the selection screen dynamically

    Hi,
    I have a requirement to create the selection screen Dynamically. All the fields that should appear on the selection screen will be available in a custom table. So, based on the entries available in the Z tables, the selection screen should be built. Eg. If there are 10 records available in the Z table, the selection screen should consist of 10 fields. If there are 100 entries, the Selection screen should contain 100 fields. and the logic to build this selection screen should be carried out dynamically in the program.
    Could anyone of you please share the valuable inputs on this. If anyone has the sample code to do this, please share.
    Thanks in advance.
    Regards,
    Paddu.

    Hi,
    Kindly go through this sample program below:
    DEMO_LIST_FORMAT_INPUT *and
    check this function module:
    FREE_SELECTIONS_DIALOG *.
    Hope it helps
    Regards
    Mansi

  • Default Value for a selection screen field

    Hi Experts,
    I am having a selection screen with a date field i am defaulting the date field to sy-datum but i also have a option of changing the date field value.
    The issue is i have defaulted the date field value in PBO event,so when i change my field value in selection screen every time the defaulted value is appearing instead of my new changed value.
    Plzz suggest a solution.

    Hi ,
           Actualy u should set the default value at the time of selection screen, but now from the same logic try to write like
       If Date is initial.
         data = sy-datum.
        endif.
    in ur PBO
    Try this.
    THank
    -Anmol
    Hi Experts,
    I am having a selection screen with a date field i am defaulting the date field to sy-datum but i also have a option of changing the date field value.
    The issue is i have defaulted the date field value in PBO event,so when i change my field value in selection screen every time the defaulted value is appearing instead of my new changed value.
    Plzz suggest a solution.

  • Layout default option on the selection screen

    I have given a Select Layout box on the Selection screen of my ALV report. How can I pass the default layout value, already set in the report to the box on the selection screen as the default value.

    DATA: RS_VARIANT LIKE DISVARIANT.
    SELECTION-SCREEN : BEGIN OF BLOCK B10 WITH FRAME TITLE TEXT-024.
        PARAMETERS       : PA_VARI  TYPE SLIS_VARI.
    SELECTION-SCREEN : END OF BLOCK B10.
    FORM ALV_VARIANT_F4  CHANGING P_PA_VARI.
      DATA: "RS_VARIANT LIKE DISVARIANT,
             NOF4       TYPE C,
             G_REPID    TYPE SY-REPID.
      MOVE SY-REPID TO G_REPID.
      CLEAR NOF4.
      LOOP AT SCREEN.
        IF SCREEN-NAME    = PA_VARI.
          IF SCREEN-INPUT = 0.
            NOF4 = 'X'.
          ENDIF.
        ENDIF.
      ENDLOOP.
      RS_VARIANT-REPORT   = G_REPID.
      RS_VARIANT-USERNAME = SY-UNAME.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          IS_VARIANT = RS_VARIANT
          I_SAVE     = 'A'
        IMPORTING
          ES_VARIANT = RS_VARIANT
        EXCEPTIONS
          OTHERS     = 1.
      IF SY-SUBRC = 0 AND NOF4 EQ SPACE.
        PA_VARI = RS_VARIANT-VARIANT.
      ENDIF.
    ENDFORM.                    " ALV_VARIANT_F4
    Following code is used to get the Layout selection box on the selection screen.

  • Default values in se16 selection screen

    Hi,
    when we open SE16 along with table name , In the selection screen of that table i want some default values apper for one particular field.
    How can i do that???

    Hi,
    it`s not possible to fill the fields only for this selection.
    You can work with variants, i think, this is the best way.
    On the other hand you can work with parameter-id´s. Most of the fields have this and you can enter it in you user-paramters. This variant has the effekt that the value will shown in each transaction, where this parameter-id is used.
    Regards
    Nicole

  • Comapare the string value in the selection screen

    In the selection screen input field
    there is an option of selecting the directory and file name and not the extension .
    This is used to download the datas
    Extension can be selected by using the option button
    rtf
    csv.
    the user has to give only  the filename and not the extension.
    suppose if the user input is C:\temp\file1.doc.
    Either i should take only the filename
    or i should display the message give only the filename and not the extension . its already been selected!!!!
    I want to compare the input string contains  .doc
    how to do the comparison and to get the above results mentiond
    Thanks
    ABAPer

    hi,
    I have already done using the method given by you.
    Because the requirment is there are two option buttion for selecting the download file format
    But unknowingly if the user gives the filename along with the extension. I need to handle that error
    giving some error message or information message
    By comparing the last 4 letters of the filename.. either.doc or rtf or csv or watever
    so how to do that
    then after comparing that i should give the user a msg doc type is already selected give only the filename
    I hope u understand my req
    thanks

  • Modifying the selection screen dynamically

    Hey folks,
    I have posted this question previously but no one understood the real problem.
    I have 4 fields
    Company Code
    material Number
    plant
    storage Location
    Unit
    when I select the company code AA01 from the F4 help I want to disable material number and Plant ..Like this i have 4 scenarios where based upon the input given in the selection screen other fields have to be enabled or disabled.
    I have already used at selection screen on output but that doesn't help me as its a PBO event I tried to search for a proper event but cudn't find it. Is there any way i can achieve this. A sample code wud be easy for me to understand .
    Thanks in advance
    Rock

    Set different groups in your fieds on the screen.
    Set the screen group for the Material and Plant as the GR1
    Set the screen gorup for the Storage location as the GR2.
    You need to modify your screen fields on the PBO event.
    Like:
    IF P_BUKRS = 'AA01'.
    loop at screen.
       if screen-group1 = 'GP1'.
         screen-input = 0.
         modify screen.
       elseif screen-group2 = 'GP2'. 
         screen-input = 1.
         modify screen.
       endif.
    endloop. 
    else.
    loop at screen.
       if screen-group1 = 'GP2'.
         screen-active = 0.
         modify screen.
       elseif screen-group2 = 'GP1'. 
         screen-input = 1.
         modify screen.
       endif.
    endloop. 
    endif.
    Regards,
    Naimesh Patel

  • Capturing elements value in the selection screen for LDB during run time

    Hi,
    I have a program where LDB is used.
    Could anyone please suggest how to capture the values of the elements present in the LDB's default selection screen.
    Specially, the company code and the period values.
    Please reply . Its too urgent.
    Regards,
    Binay.

    I got it

  • Setting ranges as default values for a selection screen value

    i have a selection screen parameter s_yywrpc. For this s_yywrpc i have to set some range of values as default values.
    Can u tell me how can i do that .
    select-options:s_yywrpc for vbak-yywrpc.
    for this parameter i have to set MSPG, MSP, FMP, FMPG, CFEG, FCFG, CMSG, CMSP as the default values in selection screen
    can anybody tell me how can i code this
    thanks
    pavan

    >
    pavan kumar wrote:
    > i have a selection screen parameter s_yywrpc. For this s_yywrpc i have to set some range of values as default values.
    > Can u tell me how can i do that .
    >
    > select-options:s_yywrpc for vbak-yywrpc.
    > for this parameter i have to set MSPG, MSP, FMP, FMPG, CFEG, FCFG, CMSG, CMSP as the default values in selection screen
    >
    > can anybody tell me how can i code this
    >
    >
    > thanks
    > pavan
    in the intialization event.
    INTIALIZATION.
    s_yywrpc-low = 'MSPG'.
    s_yywrpc-sign = 'I'.
    s_yywrpc-option = 'EQ'.
    append s_yywrpc.
    s_yywrpc-low = 'MSP'.
    append s_yywrpc.
    do it all for the values.

  • How make default values in the selection criteria of BEx query????

    Hi all
    I have to create a brand new query, in the selection criteria(Prompts) I have two prompts. one prompt should show current budget year and second prompt should show next budget year, both prompts are mandatory and default.
    Can any one please let me know how to obtain current and next budget year??? do I need to write any customer exit or do i need to create a offset???
    Two prompts are using same infoobject 0fiscper which is mapped to ECC Table MBEW and field is LFGJA.
    Thanks

    HI sathiyaa,
    so you want to show user with two prompts one will show current year and the other next year value by default.
    //tell me that if you user change the current year value for ex: it will show 2011 by default.. and user changed it to 2009.
    you want to show 2009 year results or 2011 even though he changed the prompt.
    Here i'm considering that even though user changed current year to some other year still you want to show the current year results.
    Create a customer exit variable for calyear with ready for input (checked).
    customer exit code in CMOD :
    when ' customer exit var for cal year'
    IF I_step = 1.
    clear l_S_range.
    l_S_range-low = sy-datum+0(4).
    l_s_range-sign = 'I'.
    L_s_RANGE-opt = 'EQ'.
    ENDIF.
    if i_step = 2.
    data: zyear(4) type c.
    zyear = sy-datum+0(4).
    ex: l_s_range-sign = 'I',
    l_s_range-opt = 'EQ'.
    L_s_range-low = zyear.
    appen l_s_range to e_t_range.
    after this create a variable offset
    create a new selection in the structure, drag the KF and calyear restricted by current year variable . Copy the same selection and insert it as a new selection, go back to the calyear restriction, right clik on the variable. specify variable offset and enter + 1.
    or search in sdn how to create variable offset it will help you
    Regards,
    Ranganath.

  • Default Values in IW73 Selection screen

    Hello Experts,
    SAP transaction IW73 has a default entry 100004731 for functional location.
    Please guide me how to remove this entry and defaulted to blank?
    Thanks!!!
    Br,
    Arun

    Hi,
    Generally default values can be assigned to transaction by BADI implementation. So, search for the BADI of IW73 transaction and deactivate the implementation.
    Hope this will be helpful for you.
    Regards,
    Supriya.

Maybe you are looking for