Clearing the displayed value for a SELECT-OPTION

How do I clear the displayed value of a SELECT-OPTION? 
I have 2 SELECT-OPTIONs on my screen (standard basic report program screen).  I use code like this to populate the drop-down boxes for each one. 
=====
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prgrp-low.
  PERFORM fill_prgrp_values.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
  PERFORM fill_prctr_values.
=====
The value the user picks for the first SELECT-OPTION will affect what values I put in the drop-down list for the second SELECT-OPTION. 
If a user enters a value for the second SELECT-OPTION, and then goes back and changes the value of the first SELECT-OPTION, then I want to do two things:
1.  Create a new set of values for the drop-down list for the second SELECT-OPTION (no problem; working fine);
2.  Clear the displayed value from the second SELECT-OPTION that the user entered previously.  That value became invalid when the user picked a new value for the first SELECT-OPTION. 
How do I clear that second displayed value? 
I have tried CLEAR and REFRESH for the second variable using the formats s_prctr, s_prctr[], and s_prctr-low.  They will erase the values of the internal table or part(s) of it, but the displayed value stays on the screen. 
I need to clear out the displayed value so the user will either leave it blank or enter or select a new value. 
I am using F4IF_INT_TABLE_VALUE_REQUEST to build the drop-down lists, and it works fine, but I do not see any function module to clear the displayed value off the screen. 
Thanks for your help.

Sorry, but calling DYNP_VALUES_UPDATE did not work.  This is how I coded it. 
fld_reset_rcd-fieldname  = 'S_PRCTR'.
  fld_reset_rcd-stepl      = sy-stepl.
  CLEAR fld_reset_rcd-fieldvalue.      "  re-initialize s_prctr
  CLEAR fld_reset_rcd-fieldinp.        "  what goes in here?
  APPEND fld_reset_rcd TO fld_reset_tbl.
  CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      dyname = 'ZFI_GL_BALANCE_NGL'
      dynumb = '1000'
    TABLES
      dynpfields = fld_reset_tbl
<Added code tags>
I have discovered that CLEAR and REFRESH of s_prctr will clear it somewhat.  If I enter multiple values, ranges, etc., they will all be cleared, EXCEPT for the one single value that is displayed on the main screen.  It is not cleared and it remains if you push the button to display the pop-up to enter ranges, etc. 
To devrath.sampat  --  Thanks for your example for building the drop-down list, but that is not the problem I am having.  I am already able to build it just fine. 
To repeat my problem, if I: 
1.  first enter / select a value for the first SELECT-OPTION s_prgrp
2.  then enter / select a value for the second SELECT-OPTION s_prctr
3.  And finally go back and select a new value of the first SELECT-OPTION s_prgrp from its drop-down list,
     when I do, the program needs to clear the value displayed on the main screen for the second SELECT-OPTION s_prctr (any additional values, ranges, etc., are cleared by CLEAR and REFRESH, if I go look; but not the value shown on the main screen).
Edited by: Scott Crosby on Feb 14, 2012 4:20 PM
Edited by: Suhas Saha on Feb 15, 2012 12:03 PM

Similar Messages

  • How To... Change the Data Type for a SELECT-OPTIONS at run time.

    Hello,
    I am trying to restrict the values available for entry into a SELECT-OPTIONS at run time depending on user input.
    The logic is as follows. The user has two input fields. A PARAMETER field which has the type RSDIOBJNM and allows them to choose an InfoObject. And the user has a SELECT-OPTIONS field to allow them to select the Characteristic values for that InfoObject.
    I would like the following example to be possible:
    The user enters 0MATERIAL into the PARAMETER. When the user clicks on the SELECT-OPTIONS control code will derive a list of possible options the user can enter in the SELECT-OPTIONS. In this case only values found in the master data or at least no values greater than 18 characters.
    I have looked at the following function module SELECT_OPTIONS_RESTRICT and this do not appear to be helpful as they only restrict on the signs allowed for the values (unless I misunderstand, it is a complex function module!).
    The code I have so far is (thus the user enters a InfoObject into p_char1 and the select options so_char1 should only accept active values of that InfoObject):
    declaration of variables for user interface
      DATA c_char(32) TYPE c.
    declaration of count variable
      DATA i_count TYPE i.
    declaration of user interface
      SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
        PARAMETERS: p_ipack TYPE RSLOGDPID.
      SELECTION-SCREEN END OF BLOCK a1.
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
        PARAMETERS: p_char1 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char1  for c_char NO INTERVALS.
        PARAMETERS: p_char2 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char2  for c_char NO INTERVALS.
        PARAMETERS: p_char3 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char3  for c_char NO INTERVALS.
      SELECTION-SCREEN END OF BLOCK b1.
    Is what I am trying to do possible???
    Thanks for any help. Ross.

    You really want to restrict possible values of a select-option based on another field, not change the length of type of the select-option field, right?
    Here is what you do:  Code a custom F4 value help for the select-option at event AT SELECTION-SCREEN ON VALUE REQUEST FOR..  The first thing you do here is read the value of the parameter field (p_ipack in your example).  You can use function module DYNP_VALUES_READ.  Based on this value, you can propose values for the select-option fields.  Note that the use can still enter whatever s(he) wishes in to the select-option field without pressing F4. In this case, you will have to code some input validations taking into account the value in the p_ipack field.

  • Setting the value of a textbox to be the display value of a selected item

    I have two seperate regions on the same page. In the top region I have a select list with submit and in the bottom region I have a textbox. I can get the value of the textbox to be set to the RETURN value of the select list, but it is merely a number. I would like for the value of the textbox to be set to the DISPLAY value of what the user has selected from the select list. How can I accomplish this?
    Thanks,
    BoilerUP

    Hi BoilerUP,
    Can’t you create an item based on a select, that returns the value you want?
    select text from mytable where id = :myselectlist_id;
    Regards Pete

  • How to display the display value of a select list

    I want to display the display value instead of the return value of a select list but don't know how to do it, can someone help me?

    When you created the select list item, you are ask to provide a list of values query which can either be a SQL query or a Static List, which both follows the pattern of
    Dispaly;Return.
    Example:
    SQL query -
    select 'Yes' col1, 'Y' col2
    from dual
    Static -
    STATIC:Yes;Y
    which will display 'Yes' but will actually, return 'Y'.
    how did you set your select list item?
    Thanks,
    Marilyn

  • Adding default value for a select-options in a selection-screen

    hello gurus,
    i have a report program with the following select-options in a selection-screen block:
    select-options:  so_site  for MyTable-werks.
    i want the so_site to have a default value once the program displays. can it be possible?
    regards,
    sid

    Hi sid,
    1. Whenever we use select-option,
       an internal table of type range is
      automatically created.
    2. so, in fact, we have to put
       record in this internal table.
    3. eg. Just copy paste in new program.
    4.
    report abc.
    tables : t001.
    select-options : bukrs for t001-bukrs.
    initialization.
      bukrs-sign = 'I'.
      bukrs-option = 'EQ'.
      bukrs-low = '1000'.
      append bukrs.
    regards,
    amit m.

  • Display values for multiple selection

    In the code below, I am trying to display multiple values for Drop down list. when i run the code below the value "AA" is only selected on the screen but not BB.
    I want to display both AA and BB selected.
    Please any help/suggestions:
    <%@ page import="java.util.*"%>
    <jsp:useBean id="ab" class="com.a.b" scope="session"/>
    <select name="lstTyp" multiple>
    <%
    String Type[]= ab.getTyp();/*(VALUES ARE "AA-AA,BB-BB,CC-CC,DD-DD")*/
    String choiceType;
    String getTyp1 = "AA,BB";
    String getTyp = "";
    StringTokenizer parser = new StringTokenizer(getTyp1,",",false);     
              int numTokens = parser.countTokens();
              for(int j = 0; j <numTokens; j++)
                   getTyp = parser.nextToken();
                   for(int i=0; i<Type.length; i++)
                   {   choiceType = Type[i].substring(3);
                        if( getTyp.equalsIgnoreCase(Type.substring(0,2)) )
                             out.println("<option value=\"" + Type[i].substring(0,2) + "\" SELECTED >"+ choiceType );
                        else
                             out.println("<option value=\"" + Type[i].substring(0,2) + "\">"+ choiceType );
                   System.out.println(getTyp);
    %>
    </select>

    <select name="lstTyp" size="5" multiple>

  • Highlighting TEXT - not the field - and clearing the set value for a new one

    I have a form in which various text fields are set with a message to inform the user as to what kind of information I want typed in. My goals are:
    1. Have the text get highlighted so when the user starts typing, the "old" value gets replaced with the "new"
    2. Or, when the user tabs or clicks in the field all of the "old" value is deleted and they can start typing the "new" value from the beginning of the field.
    I am trying to eliminate having to manually highlight the field in order to type in the needed information. But each field needs to start with a value so the user knows what kind of information I am looking for.
    Does this make sense? By the way, I have no JavaScript experience...uh oh!

    Use the Media Manager (under the File menu bar item).
    Link:
    What Can You Do with the Media Manager?

  • Accessing display values of a select list (or LOV)

    Hi all,
    I was asking myself if it is possible to access the display values of a select list (to be added to a report header and to the Head section of a pdf export),
    and to call them in form of the &xxxxx. notation
    e.g. if &P10_REGION. return the selected value (e.g. 1), I would like to have the corresponding display value (e.g. USA) .
    Kind regards,
    Boris

    Thank you Graham,
    unfortunately I'm a newbie regarding Javascript. Reading the APEX help, I could understand something but not everything.
    I would enter into the page html body the following script
    <script type="text/javascript">
    document.getElementById('P10_hiddenItem').value = document.getElementById('P10_referenceItem').text;
    </script>
    Is this the correct approach?
    how should I then submit the page?
    Thank you,
    Boris

  • Get the display values of a multi selection listbox

    Hello, I am creating a visual jsf project and I have a multi selection listbox component. I have bound this component with a table of my database. For the value of the listbox's items I use the "id" field of the table, and for the display value I use the "name" field. I know that with the method getSelectedValues() I get the values "id" of the listbox, but what I want is to get the display values of the selected items of the list box. How do I do that?I have tried this code:
    Object[] selectedareas=getSessionBean1().getAreas();
    String[] mySelections=getSessionBean1().getAreas();
    selareas=areasDataProvider.findAll("id", selectedareas);
    for(int i=0;i<selectedareas.length;i++){          
    some= (String) areasDataProvider.getValue(areasDataProvider.getFieldKey("are_name"), selareas[i]);
    but I get an java.lang.ArrayIndexOutOfBoundsException: 0 error. Any suggestions?Thank you in advance!

    The way I get it in my <f:selectItems> is by binding my multi select listbox, with my database. So what the code is on my jsp page is:
    <f:selectItems binding="#{addcases.multiSelectListbox2SelectItems}" id="multiSelectListbox2SelectItems"value="#{addcases.languageDataProvider.options['language.id,language.lang_name']}"/>and I don't know how to work from here..

  • How to display the "display values" in READ Only mode for a SHUTTLE

    Hi,
    I have a form item of type *'Shuttle'* and using the following LOV.
       select DEPTNAME d, DEPTNO r
        from  DEPTIn normal mode..it displays the department name and internally store the Deptno..
    Now I converted this item to Read Only mode using Read Only Condition Type
    the problem is as soon as it becomes read only...it displays the deptno....not the department name
                Department-   10:20:30How can I display the "display values" i.e the actual department name in read only mode..
                Department-   Department1:Department2:Department3Thanks,
    Deepak

    Hi,
    It seems feature. Shuttle is span tag when it is read only.
    Work around could be that
    you compute display as text item with LOV display value according shuttle session state and show shuttle and this item conditionally depend case
    Br, JAri

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • How to set the default values for print options

    Hi all,
    We can set the default value for print options, just like Logical destination、numbers of messages、print immediately and so on, so where we should to maintain these default?

    Hi Sandy,
    This can be done by an abaper by making changes in the driver program. The Driver program feeds all the data which u have mentioned for printing.
    if the driver program is standard. copy to an z type and make modification on printer settings on the driver program code.
    this will surely solve the issue.
    Regards
    Gunaseelan

  • One search help for multiple select-options in webdynpro abap

    Hi,
    I need a way to use one search help for multiple select-options fields. My scenario is :
    I have a table for keeping different organizational units' values of different systems. I have pasted some sample data from this table at the end of this mail. On the screen I want to have 1 select-options filed for werks, and 1 select-options filed for vkorg. (In fact I will have more org. unit fields...) In the beginning of my application the user will select sid.
    If the user selects ADS as SID, when he opens search-help for the first org. unit (werks), he will see the records with SID: ADS, VARBL = $WERKS, LANGU = SY-LANGU.
    If the user selects AGT as SID, when he opens search-help for the second org. unit (vkorg), he will see the records with SID: AGT, VARBL = $VKORG, LANGU = SY-LANGU.
    I have created a search-help taking SIDD, VARBL and LANGU as import parameters; used field mapping and bound this search help to my table. I have created 2 context nodes : org1 and org2 having attributes SID, VARBL, VALUE, LANGU .
    I have assigned related SID, VARBL and Langu values to these attributes at runtime as I needed. That way, if I use input field and reference to the related context attributes org1-value and org2-value2 accordingly, search help works well as I want.
    However, when I use select-options field , I can not bind the field to the context data. I can give reference only to ddic structure. Is there any way to reference to a context attribute? I searched for this in SDN, but could find nothing.
    I think I won't be able to use this way. What do you say?
    As I read from forums maybe using OVS help will be suitable for me. But I have to use one search-help for all select-options fields. Do you know how I can determine the active select-options field and pass its name (for instance "werks" ) as parameter to this OVS search help. (Also I'll pass SID and LANGU.)
    MY TABLE (ZBYYT080) CONTENTS:
    SID     VARBL     VALUE     LANGU     VTEXT
    ADS     $WERKS     1     T     Werk 0001
    ADS     $WERKS     11     T     OZYAS  GIDA URETIM YERI
    ADS     $WERKS     5501     T     BOYA GEBZE FABRİKASI
    ADS     $WERKS     5502     T     BOYA CIGLI FABRİKASI
    AGT     $WERKS     2301     T     KAMLI DAMIZLIK
    AGT     $WERKS     9601     T     PANAR DENIZ URETIM YERI
    ADS     $VKORG     22     T     AA KİMYASALLAR
    ADS     $VKORG     8001     T     İINSAAT BOYALARI
    AGT     $VKORG     6500     T     DAMk St.Org
    AGT     $VKORG     5400     T     PANAR St.Org.
    I wish I'm clear enough..
    I will be gald if someone answers me as soon as possible...
    Thanks İn advance..
    MERAL

    Hi,
    Your ques is how to refer to a DDIC search help to refer to selection screen parameter ?
    Am I right ?
    If Yes, then in the interface IF_WD_SELECT_OPTIONS
    method ADD_SELECTION_FIELD, ADD_PARAMETER_FIELD etc
    have importing param like I_VALUE_HELP_TYPE and  I_VALUE_HELP_ID, I_VALUE_HELP_MODE, I_VALUE_HELP_STRUCTURE
    etc which may help you to link your create DDIC Search help to selection screen params.
    this is just a clue from my side. I haven't tried it myself.
    You can go to the where used list of this method and find some sample implementations which use these params.
    Hope this helps.
    Regards
    Manas Dua

  • Is it possible to change the display value of a domain-based attribute?

    Hello,
    I've selected a domain-based attribute for one of the leaf member attributes in the same entity, aka parent id, since it's a self-referencing entity.  However, I cannot find a way to display anything but the code value in the drop-down (see below).
    Is there a way to change the display value so that I can choose the attribute from the entity from which I want the user to choose? In other words, I would like to display the hierarchy name instead of the code, which is really just the primary id.
    Thanks in advance!
    Ben Lezin

    1. In the explorer page, settings dialog, you can change the display format to show only name.
    2. We cannot use other freeform attribute as DisplayFormat, rather than Code Name. So there are 2 option here:
    a. Remove HierarchyName attribute and just use Name attribute. In the next release, we will allow give Name, Code attribute a displayname, so you can give Name display name as "HierarchyName" in the SQL Vnext release.
    b. Make a Business Rule to update Name when HierarchyName is changed.

  • Display values for logical columns with several physical sources

    Hi all,
    I'm enocuntering some strange behaviour with the values displayed for a column (when we want to add it a as a filter, and in the dialogue box select 'Show All' values).
    Basically the logical column is mapped against several physical columns as the base fact table is aggregated to different levels. Additionally, one column in the fact tables has an attribute value, and these vary between the aggregated and non-aggregated table. This is not a problem.
    In the production environment, when we display the all values in the filters prompt for this column we are seeing the values being taken from one fact table. Naturally this means that not all the values possible for this column are being shown (i.e. values from the aggregated fact tables are missing). Now in one of our test environment where those fact tabels have additional data loaded, the values are being taken from one of the other fact tables. Unfortunately it is not necessarily the fact table with less data.
    My questions are:
    a) What dictates which fact table the server will use when the query in Answers doesnt use any dimensions (i.e. we are selecting just this attribute and selecting all the possible values by which it can be filtered)?
    b) Is there a way of obtaining all the values from the differente physical columns? I.e. that the display values shows the values of that logical column across all the physical fact tables? Maybe we would need to model that attribute as a logical dimension just for that attribute? Im not really sure this would work, as at the physical level the join between the dimension and fact would still have to go to only one particular fact table.
    Any info or help is much appreciated.

    Hi,
    Aggregate tables exist at physical level and are created by ETL procedures. Although i am aware that the dimension come into play when the application needs to decide which source aggregate table to use, it is not an issue here as in our query we are not involving dimensions. We are selecting just this one columen, and then the filter option on this column, then in the dialogue box we select 'All Choices', only the values from one of the source tables is being shown.
    This is not a probelm within reports, i think it is a product limitation in that in that option to list all values a user can filter by, it is not possible to display all the values from the different fact tables to which that column is mapped.
    Has anyone else encountered this behaviour?

Maybe you are looking for