Filtering values in a dropdown list box

Hello Team
In the BSP application CRM_IC, we want a drop down list box to be filled based on the entry selected from another dropdown list box. We have all the entries for the second drop down box in ABAP internal table .However, we do not want a server round trip to happend in doing so. Thus we have used the attribute 'Onclientselect' and we are trying to call a java script function call on this event to filter this ABAP internal table . In this function, we would like to fill the contents of the second dropdown list box after reading the contents of the first dropdown list box. Please advice us as to how this can be achieved. Basically, we observed that ABAP server side script is not executed in the java function.
Thanks
Rony

Rony,
I have used the following technique to synchronize the
contents of two drop down list boxes.
<b>Scenario:</b>
The selection in listbox ddlbxSystemEquipNum, which I
will call "A", determines the contents of listbox
ddlbxModuleEquipNum, which I will call "B".
I use a JavaScript array to shadow the ABAP internal
table containing the possible values for listbox B.
When the page is initially displayed, listbox B is
populated from the ABAP internal table.
When a new selection is made in listbox A, I use the
onClientSelect event to call a JavaScript function,
updateModuleList(), to update the contents of listbox B
from the JavaScript shadow array based on the selected
value in listbox A.
<b>Code Excerpts:</b>
<u>Declare the JavaScript shadow array and listbox B update function</u>
<script language="javascript" type="text/javascript">
    var moduleArray = new Array();
    function updateModuleList() {
        var selSystem = frmNrg1100.ddlbxSystemEquipNum;
        var selModule = frmNrg1100.ddlbxModuleEquipNum;
        // Get selected system equipment number
        var selected_system =
                selSystem.options[selSystem.selectedIndex].value;
        // Clear module select options
        selModule.options.length = 0;
        // Add module select options for the selected system
        var j = 0;
        for (var k = 0; k < moduleArray.length; k++) {
            if ( (selected_system == moduleArray[k].system) ||
                                     moduleArray[k].system == "") {
                selModule.options[j++] = new Option(moduleArray[k].text,
                               moduleArray[k].value,
                               moduleArray[k].selected) ;
</script>
<u>Specify the onClientSelect event handler on list box A</u>
<htmlb:dropdownListBox
    id = "ddlbxSystemEquipNum"
    width      = "400"
    onClientSelect = "updateModuleList()"
<u>ABAP and JavaScript to populate internal table and shadow array of possible values for listbox B</u>
<%
loop...
        wa_module_options-system   = wa_customer_tool-equipment_num_t.
        wa_module_options-text     = tool_list_text.
        wa_module_options-value    = wa_customer_tool-equipment_num_m.
        wa_module_options-selected = selected.
        append wa_module_options to module_options.
%>
<script language="javascript" type="text/javascript">
    // Add all possible Module select options to a JavaScript array of objects
    moduleArray[moduleArray.length] = {  system:"<%=wa_module_options-system %>",
                                           text:"<%=wa_module_options-text %>",
                                          value:"<%=wa_module_options-value %>",
                                       selected:"<%=wa_module_options-selected %>" } ;
</script>
<%
endloop.
%>
Hope this helps.
Regards,
Shawn

Similar Messages

  • How to read the selected value of a dropdown list box

    Hello,
    I have 2 custom fields which are of type dropdown list on Accounts(CRMM_ACCOUNT) PCUI application details tab.I need to read the selected value of first dropdown list item,based on that second dropdown list will be populated.
    I know where to populate the dropdown list box,it is in FILL_DROPDOWN_LISTBOX.
    I dont know how to trap the selection made on dropdown list.
    PLease guide me on how to trap the dropdown list field selection value.
    Thanks in advance.
    Thirumala.

    Hello,
    Check what is done in standard for the fielf REGION which is inked to the country.
    Otherwise, you can do the following :
    - in field group customizing, for field 1, flag the 'send request' flag. So, when you change the value in this field via the dropdown, the MAC methods are immediately called.
    - Put the new value in a global variable (GV).
    - in the fill_dropdown_listbox method, get the value from this GV and based on it, filter the values for the dropdown of field 2.
    Hope this will help you,
    Regards,
    Frederic

  • Selected value in dropdown list box

    hi forums,
      how to capture the selected value in drop down list box and how it will link with the table.
    layout:
        <htmlb:dropdownListBox  id = "d1%>"
                                nameOfKeyColumn = "vbeln"
                              nameOfValueColumn = "vbeln"
                             table       = "<%=it_sales%>" />
    in dropdown list box,how do i capture the selected values.
    OnInitialization:
    Select vbeln from vbak
      into corresponding fields of table it_sales.
    regards,
    ravi.

    hi Ravikiran,
       In button even,we r mension the event_type = 'click'.
    but in dropdownListBox what is the event_type.
    i tryed like this.
    DATA : EVENT TYPE REF TO CL_HTMLB_EVENT.
    ***this is for button************
    *event = CL_HTMLB_MANAGER=>get_event( RUNTIME->SERVER->REQUEST ).
    *IF event->NAME = 'button' AND event->event_TYPE = 'click'.
    DATA : button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
    button_event ?= event.
    *ENDIF.
    *********this is for dropdownListBox**********
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->name = 'dropdownListBox' AND event-         >event_type = 'selection'.
           DATA :  dd_listbox_event TYPE REF TO CL_HTMLB_EVENT_SELECTION.
           dd_listbox_event ?= event.
    CASE EVENT->ID.
    when 'id1'.
    CALL METHOD REQUEST->GET_FORM_FIELD
          EXPORTING
            NAME  = 'id1'
          RECEIVING
            VALUE = SEL.
    WHEN 'myButton'.
       CALL METHOD REQUEST->GET_FORM_FIELD
         EXPORTING
           NAME  = 'id1'
         RECEIVING
           VALUE = SEL.
    ENDCASE.
    endif.
    with regards,
    ravi.

  • LiveCycle 8.1 on Vista: dropdown list box doesn't show all values

    On Vista Business O/S, in LiveCycle 8.1, I am using a dropdown list for 254 items, not dynamically loaded (all values are declared in the definition of the object). When the form runs, the dropdown list appears. I can scroll through the list. However, the scroll stops short, never showing the last few items on the list.<br /><br />   Is there some limit I have exceeded or is there some know bug I have encountered or is there some other action I need to take so I can choose any item from the dropdown list?<br /><br />   Dropdown list box is defined as user-entered - optional, default <none>.<br />254 text items, longest item is 19 characters, average item is 10 characters long. <br /><br />   Thanks in advance for any help, hints, or tips you provide.<br /><br />Dr. Dave Dyer

    Dear Friends....
    it seems to be a bug of the SQL Server Data Tools, (SQL Server 2012 SP2)... I did the deploy of my Dashboard, (and details Reports), to my Test Reporting Services Server.. and everything works as expected....
    Cheers, Luis

  • How to attach value range table to dropdown list box

    Hi there,
    could u please explain me how to attach a value range table to dropdown list box (i.e I/O box with dropdown attribute as list with key).
    if possible please explain me with a sample code.
    Thanks in advance.
    -Tulasi.

    hi ...if the associated domain of the field that u are using as i.o field has value range the same will come as drop down list...u u select the list box option and click from dictionary check box on the attributes...
    To check if the domain has it or not...go to the domain..click on value range..u can see thr,...if values are not thr u can giv the same...
    Or if u are not refering to dictionary type then use fm VRM_SET_VALUes
    reward if the abv is helpful..

  • Is it possible to enter our own value in dropdown list box in Module Pool. How?

    Dear Experts,
    Being new to ABAP, I am trying my hands on Dropdownlist box on Module Pool.
    I want to pull data from Ztable(Custom Table) into Dropdown list box on Screen in Module pool and be able to edit it, delete it and enter new data through it, thus thereby able to manage the Ztable. Is it possible in dropdown.
    Looking forward for experts advice.
    Regards
    Deepika

    Dear Kannan,
    Thanks. But why sud I write an event in Table maintenance generator. My code is in Module Pool and it has no connection with Table Msintenance.
    The I/O field Drop down list box is on the Screen in my Module Pool. I am able to pull data in it from Ztable but now I want to edit this pulled data and also want to enter new data in this dropdown list box.
    Regards
    Deepika

  • Dropdown list boxes

    Hi friends,
    Could u please tell me how to create a module pool program to charge the content of a a field of database table in a Dropdown list boxes . Please provide me step by step Process or link of file.
    thinks .

    Hi Karim,
    see the below programs to fill the field with a valid listbox value, for example, in this program, I am building the listbox in the program and just assign P_FIELD a valid value from internal table'ivrm_values' . Create screen 100 and create a field call P_FIELD, make sure to select "ListBox" from the DropDown Field.
    report  zpavan_0001.
    type-pools: vrm.
    data: p_field(20) type c.
    data: ivrm_values type vrm_values.
    data: xvrm_values like line of ivrm_values.
    data: name type vrm_id.
    start-of-selection.
    Set default value, before calling the screen
      p_field = 'DEF'.
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    module status_0100 output.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    name = 'P_FIELD'.
      xvrm_values-key = 'ABC'.
      xvrm_values-text = 'ABC'.
      append xvrm_values to ivrm_values.
      xvrm_values-key = 'DEF'.
      xvrm_values-text = 'DEF'.
      append xvrm_values to ivrm_values.
      xvrm_values-key = 'GHI'.
      xvrm_values-text = 'GHI'.
      append xvrm_values to ivrm_values.
      call function 'VRM_SET_VALUES'
           exporting
                id     = name
                values = ivrm_values.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    module user_command_0100 input.
    endmodule.                 " USER_COMMAND_0100  INPUT
    Thanks and Regards,
    Pavankumar

  • How do I make a drop down list of text in numbers as it is made in the example spreadsheet for comparing cars for buying where you can choose a value from a dropdown list for each car?

    how do I make a drop down list of text in numbers as it is made in the example spreadsheet for comparing cars for buying where you can choose a value from a dropdown list for each car?

    Where is this example spreadsheet? Without seeing it I can only guess at what you are asking.
    To make a drop-down list (a pop-up menu in Numbers-speak), format the cell as a pop-up then edit and add to the list of items.
    If the example spreadsheet is pulling in a dollar value based on what car you chose in the pop-up, it is probably using LOOKUP or one of the other lookup functions, getting the information from another table (a lookup table). If, instead, these dollar values are what you are choosing in the pop-up, then you need to create a pop-up with these values in it.
    The Help menu includes a link to a page where you can download the Numbers Users Manual. It also has a link to the Formulas and Functions guide. Both are useful to new users.

  • Split Values in a dropdown list

    Hi friends
    i am stuck with a problem for which i need your help.i will list it out as below.
    i am having a dropdown in my jsp page a ComboBox. The values in the dropdown are in the form
    After 10 minutes
    After 20 minutes
    After 30 minutes
    Before 5 minutes
    Now when the user selects a value in the dropdown list ex. After 10 minutes. This value needs to be fetched and i have to retrive 10 & minutes seperately from the string "After 10 minutes" and the values should go into two different colums of 2 tables in the database.
    I cannot use a DTO to set these values since the values will be combination pair of value & timetype.
    What should be my approach here.
    should i use a Hashmap or a Hashtable or some list so that i can send these values from the Action class to the Session Bean method.
    please let me know what needs to be done in this case.waiting for a positive reply from your side.
    Thanks & Regards
    Vikram K

    Create your own object which can store the different values and override the toString() method to display "After 10 Minutes" etc.
    i.e.
    private class MyClass {
       private int unit;
       private String measurement;
       public MyClass {
          super();
       // Getter and Setter Methods for fields
       public String toString() {
          return "After " + unit + " " + measurement;
    }Then you can create a custom ComboBoxModel that contains your list of custom objects. Then it's a simple case of adding an ActionListener to the ComboBox to see which object the User has selected so you can then use the getter methods to pull the info you need and populate your table.

  • Read value selected in Dropdown list in user exit

    Hello,
    I have mulitple variable in my web interface.
    The first one is a list of months that the user can change and the others are calculated by user exit.
    The problem is that i need the month in the user exit.
    When the user has already a variable set for him, with ZGET_VARIABLE_DETAILS, i can have this month.
    My problem is when the user changes the month in the web interface.
    For exemple, the user has already save the layout with 01.2006, my user exits variables will find 01.2006 and be calculated with that month. After, the user changes the month to 11.2006, the problem, is that ZGET_VARIABLEDETAIL still return 01.2006, and my user exit variable are not anymore correct. But in the interface, the header area show well 11.2006. it's confusing for the user ...
    If the user saves, that will set the month variable to 11.2006 and the next refresh will be ok.
    Any idea how i can find this 11.2006 ? the current value of the dropdown list ?
    Regards,
    Jarod

    Hello Vlad,
    The flag is well to true, and my layouts are well refreshed, but on the resfresh, the user exit variable read the month variables, and then calculation are made.
    But on the read of the month variable, even if the dropdown bow has changed, this is still the set value which is read.
    It seems that when you change the value in the dropdown, it doesn't set the value. It's only a display, and when you save, it set the value.
    The problem is that for my refresh, i need to read the new month, the "displayed" value. In the header are of my layout, it's well the new month, but i cant find it in background for my user exit variable.
    Jarod

  • Passing Values to a dropdown list within a dialog box

    I am using the app.execDialog(dialog1) command to display a dialog box on my form. The dialog box contains dropdown list (popup). I have found examples that do this but in all the examples they reference the loadDefaults function with hardcoded values.
    For example:
    loadDefaults: function (dialog)
    dialog.load(
    subl:
    "Acrobat Standard": "111",
    "Adobe Reader": "222"
    Does anyone know if there is a way to pass values into the loadDefaults via a variable etc.. I can get the data I want to populate the dropdown with but I cant figure out how to load it into the control.
    Thanks
    Ken

    Hi scamp, not sure what you're asking. What do you mean by "pass" fields from one list to another? If you need information in list 1 to show in list 2, just create lookup columns in the SharePoint list. If you mean you want to add columns to
    list 2 automatically, you'll need to make a designer workflow for that.
    cameron rautmann

  • Blank line in DropDown List box

    I have a case where I want to add a blank entry in a drop down list box that is bound to a database table. I want the blank to be the default, then the user can select the bound values if desired. How do I do this without binding the drop down box to a prepopulated array?

    Hi
    Go to the JSP source of that page and add
    <f:selectItem itemLabel="None" itemValue="0"/> before
    the line <f:selectItems binding="#{Page1.dropdown1SelectItems}" ....
    With this you can deselect the previous selection by selecting None from the dropdown list. You can also use blank spaces instead of None.
    Thanks
    Srinivas

  • What is the data type of the value returned by the List box prompt in crystal

    Post Author: Mudit Kothiyal
    CA Forum: Formula
    Hi all,
    I am creating a report which has a list box prompt. When I am selecting a single value from the list box the report is working fine, but when I am selecting multiple values its not returning any data( although data is there). Does anyone know how the prompt values are passed to the report query by the crystal. I kno it passes the value to the report as an array. But how does it pass the value to the report query.
    I am using command query to fetch data from the DB.
    Crystal Report Version: Crystal Report XI R2.
    DB: Oracle 10g
    Also does anyone know how to pass the values of the list box prompt to the report query in comma seperated format.
    Thanks & regards,
    Mudit

    Post Author: rcoleman
    CA Forum: Formula
    In regards to the latter part of your question
    The following examples are applicable to Basic and Crystal syntax.
    The examples assume that list is a String array consisting of the 3 elements: "Chocolate", "Vanilla" and "Strawberry".
    Join (list)
    Returns the String "Chocolate Vanilla Strawberry".
    Join (list, "***")
    Returns the String "Chocolate**Vanilla**Strawberry".
    Not sure about the first part of your question,sorry.

  • Values not populating in list box in dialog programing.

    hi,
    i am facing a problem i.e. i am having a listbox on screen , in pbo i am filling that listbox with some values in an internal table.
    But i am not able to populate the values i.e. while i am debugging the pai ......the list box is containing nothing.
    So needed some help in this issue.
    regards,
    somesh

    Hi,
    Try to read these links. It will give you some pointers regarding on your problem.
    <link-farm removed>
    Revert if you have still any concern.
    Thanks,
    iostreamax
    Edited by: Suhas Saha on Feb 21, 2012 8:50 AM

  • Blank value added to dropdown list in Adobe Interactive forms

    Hi,
    I see blank value being added to the value list by default to dropdown lists in adobe interactive forms. The real issue is it's being added sometimes as the first value or last value in the drop down list of values which is inconsistent and resulting in Errors sometimes.
    Is there a way by which we can control the position of the blank value added by default(SAP or Adobe) to the drop down lists in adobe interactive forms .? Secondly , Is this a SAP or Adobe upgrade issue since we observed this issue only after recent upgrades ...?
    I am using HCM processes and forms and I am not adding blank value (space) explicitly in my coding of dropdown list values .
    Thanks for your time .
    Sankeerth
    Edited by: SANKEERTH D on Aug 22, 2011 1:46 PM

    Hi Sankeerth,
    The Web Dynpro framework generates a blank entry to the value set of the dropdown listbox if the Context attribute bound to the dropdown listbox is "nullable" (see properties of the Context attribute).
    The dropdown listboxes of interactive forms will be populated with exactly the same data (value sets) as the "native" Web Dynpro dropdown lisboxes.
    For SAP NetWeaver 7 EhP2, there's a Web Dynpro test application (WDR_TEST_ADOBE_ZCI) available, which demonstrates this: Start it and see the dropdown listboxes labeled "Datatype" and "Datatype (nullable)": Both are bound to Context attributes which are of type DATATYPE_D. The only difference is that one of the attributes is "nullable". The dropdown listbox bound to the nullable attribute contains the additional blank entry.
    Watch the native Web Dynpro dropdown listboxes below the interactive form: They are bound to the same Context attributes and contain the same value sets as the dropdown listboxes of the interactive form!
    Regards,
    Ralf

Maybe you are looking for

  • Values from JSP to Struts Action Class

    Dear All, Am working on a small struts project, i want to get values from JSP in the Action class, i tried with sending variables using request through URL, it works fine, any other way is there to send the values from JSP to action class. Am not hav

  • How do you Take songs from one iTunes library and put them on another(Mac)

    Well i have some songs that i don't really listen to anymore so i don't want them on my library or any of my ipods but i don't want to delete them because i bought them so i want to put them on another itunes library i created but i cant figure out h

  • How can I sync my Sunbird in one computer with other computers and iphone?

    I have been trying to sync my 2 computers and iphone so that i can be able to access my calendar on Sunbird from all the other machines. Can anyone help me please?? Thank you in advance

  • Updating iPhone 3Gs to iOS4

    I have a small fleet of about 25 iPhone's that I want to update to the new os. My users well I do not trust them to do it themselves. Is there a way to update myself without deleting any data they have saved on their toy?

  • ITunes 10.5.3 (3) MP3 Tagging.

    With the latest iTunes 10.5.3 (3) only tagging songs imported using iTunes, if I was to purchase a LP and download the MP3 version as available through the purchase, does this mean I will not be able to tag the songs?