Populating the 2nd dropdown based on value selected on 1st dropdown

Hi,
I know that there is a similar post about this in the forum but it doesn't actually show how an event for the dropdown is created. I believe this would be a script that is done within the form (transaction SFP) itself, but could I please have an example please?
I did try to take a look at the standard ISR_FORM_SPTD form but there doesn't seem to be any scripts in this form.
Thanks and regards,
Adeline.

Hi,
Am not so sure, how were unable to locate this script. Click on the dropdown and check in the Script editor. You will get the same script. Anyways, here is the script.
<i>// If the display value is used in the data DOM,
// re-assign the corresponding data value
if (this.rawValue != "" ) {
     if (this.boundItem(this.rawValue) != "") {
          this.rawValue = this.boundItem(this.rawValue);
// START OF CODE - TO RUN AFTER SELECTION HAS BEEN MADE
xfa.record.CONTROL_PARAM.ISR_EVENT.value = "CHECK";
app.eval("event.target.SAPSubmit(false);");
// END OF CODE - TO RUN AFTER SELECTION HAS BEEN MADE
data.RequestPromotion[0].PCR_PAGE1.PCR_DE.PCRDEContent.NewScaleLevelDDL::ready:form - (FormCalc, client)
//     START OF XFO CODE - DO NOT REMOVE OR MODIFY
// If this object exists, then we are not being rendered by the XML Form Agent
if ((Exists(xfa.host.appType)) and ($.bind.ref <> "")) then
     // Note the rawValue and try to set the selection if it is present
     // As soon as you add items the rawValue will be lost
     var CurrValue = ""
     //  Check for a null - an empty XML node will return a null
     if ($.rawValue <> null) then
          CurrValue = $.rawValue
     endif
     var Found = 0
     // the data binding may contain "$data.<root data name>" instead of $record
     var DataBinding = replace($.bind.ref,Concat("$data.",xfa.record.name),"$record")
     DataBinding = replace(DataBinding,"[*]")
     for i=0 upto xfa.record.enum_list.nodes.length - 1 step 1 do
          // Find the match.  The binding value may contain "[*]"
          // so remove them first
          var ListBinding = replace(xfa.record.enum_list.nodes.item(i).binding.value,"[*]")
          if (DataBinding == ListBinding) then
               // the first two items are the name and binding attributes, then the list starts
               if (xfa.host.version < 7) then  // add a dummy item to work around a bug in A6
                    $.addItem("a","-1")
               endif
               $.clearItems()
               for j=2 upto xfa.record.enum_list.nodes.item(i).nodes.length - 1 step 2 do
                    // The order is assumed to be display and then data
                    // if the value is null, then add the empty string
                    if (xfa.record.enum_list.nodes.item(i).nodes.item(j+1).value == null) then
                         $.addItem(xfa.record.enum_list.nodes.item(i).nodes.item(j).value,"")
                    else
                         $.addItem(xfa.record.enum_list.nodes.item(i).nodes.item(j).value,xfa.record.enum_list.nodes.item(i).nodes.item(j+1).value)
                    endif
                    if (xfa.record.enum_list.nodes.item(i).nodes.item(j+1).value == CurrValue) then
                         Found = 1
                    endif
                    if ((xfa.record.enum_list.nodes.item(i).nodes.item(j+1).value == null) and (CurrValue == "")) then
                         Found = 1
                    endif
               endfor
               // Now set the selection - omitting this step means there will be no selection
               // if there is only one item in the list and no default value, we have to select the first item - Bug in Acrobat 6.02 (fixed in Acrobat 7)
               if ((xfa.record.enum_list.nodes.item(i).nodes.length <= 4) and (CurrValue == "") and (xfa.host.version < 7)) then
                    $.rawValue = xfa.record.enum_list.nodes.item(i).nodes.item(3).value
               else
                    // if available, set the selection to the default value
                    if (Found) then
                         $.rawValue = CurrValue
                    else
                         // otherwise: set the selection to the first item
                         $.rawValue = xfa.record.enum_list.nodes.item(i).nodes.item(3).value
                    endif
               endif
               // START OF CODE - TO RUN AFTER LIST HAS BEEN FILLED
               // END OF CODE - TO RUN AFTER LIST HAS BEEN FILLED
               break
          endif
     endfor
endif
//     END OF XFO CODE - DO NOT REMOVE OR MODIFY</i>
This should solve your problem.
Regards
<i><b>Raja Sekhar</b></i>

Similar Messages

  • Populating values in dropdown based on values selected in second dropdown.

    Hi,
    I  have two listboxes on the screen. Based on value chosen in first dropdown, I want to populate the values to be selected in second dropdown. How can i achieve this? I would be glad if anyone can help me out with this requirement.
    Thanks,
    Ameet

    <font color=blue>Hi,
    <li> Place 2 input fields on screen.
    <li>Set Listbox property as it is shown in the below link.
         <a href="http://2.bp.blogspot.com/_O5f8iAlgdNQ/SmPSPnRa0tI/AAAAAAAAFCQ/wW_URP-ld6o/s1600-h/drop_down-770536.JPG" target="_new">link to dropdown setting</a>
    <li>Set function code to first dropdown box to trigger event when you select value from first dropdown box. So that second one is changed.
    <li>Declare variable like below in TOP include of the module pool program.
    <pre>DATA: g_drop_1 TYPE char10,
          g_drop_2 TYPE char10,
          ucomm    TYPE sy-ucomm.
    TYPE-POOLS vrm.
    DATA: name  TYPE vrm_id,
          list  TYPE vrm_values,
          value LIKE LINE OF list.</pre>
    <li> Use screen flow logic of the screen like below
    <pre>"PROCESS BEFORE OUTPUT.
    PROCESS BEFORE OUTPUT.
    field g_drop_1 MODULE drop_down_1.
    field g_drop_2 MODULE drop_down_2.
    "PROCESS AFTER INPUT.
    PROCESS AFTER INPUT.
    field g_drop_1.
    field g_drop_2.</pre>
    <li>Corresponding code for two drop down boxes.
    <pre>&----
    *&      Module  DROP_DOWN_1  OUTPUT
    MODULE drop_down_1 OUTPUT.
      CLEAR: list[],g_drop_2.
      name = 'G_DROP_1'.
      value-key  = '1'.
      value-text = 'value_1'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '2'.
      value-text = 'value_2'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '3'.
      value-text = 'value_3'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '4'.
      value-text = 'value_4'.
      APPEND value TO list.
      CLEAR  value.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = name
          values = list.
    ENDMODULE.                 " DROP_DOWN_1  OUTPUT
    *&      Module  DROP_DOWN_2  OUTPUT
    MODULE drop_down_2 OUTPUT.
      CLEAR list[].
      name = 'G_DROP_2'.
      CASE g_drop_1.
        WHEN 1 OR 2.
          value-key  = '1'.
          value-text = 'text1'.
          APPEND value TO list.
          CLEAR  value.
          value-key  = '2'.
          value-text = 'text2'.
          APPEND value TO list.
          CLEAR  value.
        WHEN 3 OR 4.
          value-key  = '3'.
          value-text = 'text3'.
          APPEND value TO list.
          CLEAR  value.
          value-key  = '4'.
          value-text = 'text4'.
          APPEND value TO list.
          CLEAR  value.
      ENDCASE.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = name
          values = list.
    ENDMODULE.                 " DROP_DOWN_2  OUTPUT</pre>
    Thanks
    Venkat.O</font>

  • Want 2 populate value in 2nd list item based on value selected in 1st list?

    Want 2 populate value in 2nd list item based on value selected in 1st list?

    Gaurav -
    The 3rd list will not populate because nothing has been selected yet in list 2. The value in list 2 is null, so the loop to populate list (3) has nothing to load. Try the following below. This should seed your 2nd list so the 3rd list will populate.
    You will have to declare first_record boolean and first_value to match DESCC.
    first_record := true; -- NEW *****
    Clear_List('BLOCK2.ITEM2');
    FOR CurRec IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.IDD = :BLOCK2.ITEM1)
    LOOP
    if first_record = true then -- NEW SECTION *****
    first_value := CurRec.DESCC;
    first_record := false;
    end if;
    Add_List_Element('BLOCK2.ITEM2',1,CurRec.DESCC,CurRec.DESCC);
    END LOOP;
    :block2.item2 := first_value; -- NEW *****
    Clear_List('BLOCK2.ITEM3');
    FOR CurRec2 IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.DESCC = :BLOCK2.ITEM2)
    LOOP
    Add_List_Element('BLOCK2.ITEM3',2,CurRec2.DESCC,CurRec2.DESCC);
    END LOOP;
    My name is Ken, 1990 is when I started using Oracle Forms 3.0, character based in the Unix environments. And you are very welcome.

  • Dynamic dropdown based on user selection of another dropdown on the same page

    hi all, ok, I have a table which contains use data, a name,
    and a userID. for the example lets say "Simon Bullen" and my userID
    is "999".
    on a form I have, there is a dropdown box, which is dynamic
    from this table, and allows me to select Simon Bullen, however, I
    have a hidden field on the form, which when the user selects "simon
    bullen" the hidden field populates with the appropiate U number
    from the same table.... no i thought this would do it:
    <cfquery name="userNumber" datasource="userList">
    SELECT userNumber FROM dbo.Users WHERE Name =
    <cfqueryparam value="#form.Name#">
    </cfquery>
    and then my dynamic form field (hidden) would reference to
    this query....
    but it doens't work, could somebody please enlighten me? I'm
    hoping its something silly
    Thanks in advance

    You could make the value of the option the UserID and the
    option display the name.
    If that isn't what you need, I think you'll need some
    javascript to populate your hidden field based on what is chosen in
    the select.
    I think you can modify this:
    http://www.javascriptkit.com/javatutors/selectcontent2.shtml
    ...to populate your hidden field instead of a new select
    list.
    If there's a way to do that without JS I'm not aware of it.
    A third possibility: look up the UserID (based on the name
    chosen) after the form is submitted then do with it whatever you
    need to.

  • Populate 2nd combo box based on value selected in 1st combo box

    I am still using Acrobat 6 though I may be upgrading soon to Acrobat 8. I have a form with two combo boxes, the first "state" has values of MN and WI. Based on which value the user picks I would like to populate a "county" combo box with lists of counties that we deal with.
    Thanks,
    Gene

    One can set the option and export value using an arry:<br /><br />// document level script<br />// Master List of Lists <br />// Each entry in this object listeral is the name of a State <br />//Manually enter the State Names into the state field combo box <br />// The associated value is the item list, where each item is a name value pair, [<County> and [county code, zip code]] <br /><br />// state: ["county name", ["county code", "zip code"]]<br />var oStateNames = {MN: [["-", ["", ""] ], <br />                       ["St. Louis", ["MNStl", "55001"] ], <br />                       ["Carlton", ["MNSCrl", "55002"] ], <br />                       ["Pine", ["MNPin", "55003"] ],<br />                       ["Cook", ["MNCok", "55004"] ] <br />                       ], <br />                   WI: [["-", [" ", " "] ],<br />                        ["Douglas", ["WIDou", "55005"] ] ,<br />                        ["Bayfield", ["WIBay", "55006"] ],<br />                        ["Burnette", ["WIBur", "55007"] ],<br />                        ["Ashland", ["WIAsh", "55008"] ]<br />                       ]<br />                     }; <br /><br />//SetCountyEntries() on keystroke entry in state field <br />function SetCountyEntries() <br />{ <br />   if(event.willCommit) <br />   { <br />      // Get the new counties list from the Master List <br />      // Since the selection is being committed, <br />      // event.value contains the State name <br />      var lst = oStateNames[event.value]; <br />      // Clear the county list if there are no counties for the selected state <br />      this.getField("ee.address.county").clearItems();<br />      this.resetForm(["ee.address.code", "ee.address.zip"]);<br />      if( (lst != null) && (lst.length > 0) )<br />           this.getField("ee.address.county").setItems(lst); // set opiton and export value<br />   } <br />} <br />//  end document level script<br /><br />For the combo box "ee.address.county" one can create an array from the export value to populate the county code and zip code<br /><br />// custom keystroke for county combo box<br />if(event.willCommit & event.value != "") {<br />// split county and zip codes<br />var aCodes = this.getField(event.target.name).value.split(",");<br />this.getField("ee.address.code").value = aCodes[0];<br />this.getField("ee.address.zip").value = aCodes[1];<br />}<br />// end custom key stroke code

  • Pre-Populate Dropdown based on information selected in another dropdown

    Hello,
    I hope this make since. I am working on building a form using Adobe Livecycle Designer. I have a dropdown list in multiple fields on the same form that will have the same information selected. I want the additional fields to automatically populate the information a user selects in the first dropdown list. Is this possible ??? If so, what would be the script/code necessary to do so ??? Thank you for your help.
    Example
    City, State appears in 4 different fields based on the selection in field 1, the additional 3 fields auto-populates the same information.
    Field/List 1: New York, NY <-- Selected City, State
    Field/List 2: New York, NY <-- Auto Populated based on field 1
    Field/List 3: New York, NY <-- Auto Populated based on field 1
    Field/List 4: New York, NY <-- Auto Populated based on field 1

    In the exit event of the first State field, using Javascript, something like this should work:
    State2.rawValue = this.rawValue;
    State3.rawValue = this.rawValue;
    State4.rawValue = this.rawValue;
    ...where "State2", "State3", etc. are references to the other dropdowns you want to populate with the same information from the first state field.
    Be sure to set the binding values in the BINDING tab of the dropdowns to the same in each dropdown,
    Brian

  • Dynamically display title based on value selected in column selector

    Hi All,
    Can it be possible to show the report title dynamically based on value selected in column selector . suppose i have two column status and region . When i will select status in the column selector the title of the report will show " Status Summary" when i will select region then the title will change to "Region Summary". Please help me...

    Hi,
    create dashboard prompt with column selector functionality like following way
    write the following query in your dashboard prompt sql results
    select region name from subject area name
    Union all
    select sub_region name from subject area name
    like this and put one presentation variable for this dashboard prompt like var1
    in your report write formula in your column like this *case when @{var1)='region column' then 'Region Summary' else ' ' end*
    and refer this column in narrative view like @1 then narrative act like a title view.
    Hope this helps you
    Regards
    Naresh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to change the values in an LOV based on values selected in another LOV

    Hi,
    I have a requirement in ADF where there are two LOVs. Based on the values that I select in the 1st LOV, the values in the second LOV should change dynamically.
    Also, the 1st LOV accepts 3 values, for every value I select, a different query is executed to populate the 2nd LOV.
    I have a rough thought that I can use 3 different read only view objects containing these 3 queries. And based on the value I select in the 1st LOV I can execute the corresponding View object from the backing bean. But my doubt is how to link the results of that query that is executed to populate the 2nd LOV.
    Thanks in advance.
    Edited by: 886591 on Sep 21, 2011 4:48 AM

    Hi Brisk,
    Thanks for your reply.
    The link that you have provided explains how to disable and enable the other LOVs based on a parent LOV. But in my case there are two Select One Choice fields i.e. the dropdowns (sorry that I addressed it as LOV in my previous post which might be confusing). There are 3 static values in the parent dropdown where each of them are associated with a different query. for e.g if the three values in the drop down are A, B and C; if i select A, then query associated to A should be executed ; if i select B, then query associated to B should be executed and if I select C, query associated to C should be executed. Then the output attribute of that query should be populated in the child dropdown.
    Please let me know about the solutions to this.
    Thanks,
    Kavitha

  • How to make a value changed based upon values selected in dropdown menu

    Hi,
    I am making my first Dreamweaver website using Dreamweaver CS6 on a windows 8 PC.
    I am trying to make a website where the user selects different criteria; in this example an ipod's model, condition and size from three seperate dropdown selections (similar to www.itrado.co.uk) and then based upon these selections a value for their ipod is shown. However i cannot work out how to display a value which remains on the same page and changes based upon the values which have been selected from the dropdown boxes. I was planning on creating a database and then creating a simple code which retrieves the value from the database which corresponds to the three selected values, however i am not sure how to go about doing this.
    Any help would be greatly appreciated.
    Many Thanks,
    Henry

    You need scripts for this. Try this jQuery tutorial
    http://anthonygthomas.com/2010/03/14/display-form-fields-based-on-selection-using-jquery/
    Nancy O.

  • Infopath: How to load data in one field based on value selected in another field

    We have a drop down list field in the infopath form and we have some more fields that should change depending on the dropdown selection. 
    How can we achieve this please ?
    Thank you !

    Hi Prajk, sounds like you want to do cascading dropdowns. If so, see the link below. If you're just trying to enter information into a field (not a dropdown) based off the value of the dropdown, then set a rule so that if dropdown = "this," set
    the field's value to "this."
    http://blogs.msdn.com/b/bharatgupta/archive/2013/03/07/create-cascading-dropdown-in-browser-enabled-infopath-form-using-infopath-2010.aspx
    cameron rautmann

  • Creating select option with the search help based on other select option

    Hi,
    I have displayed a selection screen with two select options S1 and S2.
    My requirement is that the values in the search help of S2 should get filled based on the values selected in S1.
    Note: User has option to select multiple values in S1.
    Does anybody know how to implement this?
    Thanks,
    Feroz

    >
    Sanjeeva wrote:
    > Hi,
    >
    > With standard f4 you cannot acheive this. You need to write customise with OVS or Simple value selector by reading S1 selected values.
    >
    > Thanks,
    > Sanjeev
    I'm getting fairly tired of seeing this completely incorrect information on this forum.  As stated before and already found out by this poster, you can map input and output values between multiple data dictionary search helps. You do NOT have to resort to using OVS for this option.

  • Cond display of drop down based on value selected in another drop down form

    Hi,
    I have a requirement in my app in which I need to be able to conditionally display the values in the drop down down list based on the values selected in another drop down list...
    Currently I have 2 drop downs.
    First drop down is a list of Jacks from 2000 to 4999...
    Second Drop down consists Chassis ranging from 1 to 900..
    So when a user selects any jack between 2000 - 2999, in the second drop down only Chassis ranging from 1 to 300 should appear.
    when anything between 3000 - 3999 is selected, Chassis ranging from 301 to 600 should appear..
    and for jacks between 4000 - 4999, Chassis ranging from 601 to 900 should appear in the second drop down.
    Can someone please provide me pointers on how to do this..
    Thanks,
    Nehal

    Hi Larry,
    Thanks for your response..
    Here are the queries for my select lists.
    P62_JACK
    select list query for Jacks:
    select JACK_NUM display_value, JACK_NUM return_value
    from CTS_LIST_OF_JACKS
    order by 1
    P62_CHASSIS_BLADE_PORT
    select NETWORKPORT display_value, NETWORKPORT return_value
    from CTS_LIST_OF_NETWORKPORTS
    order by NETWORKPORT_ID
    jacks range from 2000 to 4000
    chassis_blade_port ranges from 100 to 900...
    Can you please let me know how to do it..
    Thanks,
    Nehal

  • Contents of second prompt list based on value selected in first prompt?

    I need to display two prompts: "Product Family" and "Products". When the user selects a product family, I need the list of products to be filtered to the selected product family. In other words, the contents of the second prompt's list needs to be based on the value selected in the first prompt. Can this be done in Web Intelligence?

    Hello Waters,
    Yes, this can be done in web intelligence if you apply cascading prompts at universe level
    or
    Yes, the second way is use element link in report block between 2 tables one for product family and one for product list ( you don't need prompts in this case...)
    Regards
    Subbarao M

  • Dashboard Prompt - Bypass filter based on value selected in prompt

    Hi All
    I need to create a dummy dashboard prompt that has displays two values 'Y' and 'N' (Yes and No). If 'Y' is selected, I want the report to 'Filter based on the results of another request'. If 'N', then the report takes the usual filters (not taking the 'Filter through another request' filter).
    I have achieved this in the report filter by using an 'OR' clause (The Project Number is in Project Number Report OR 'N' = 'N' (presentation variable from the prompt) ). So if 'N' is selected the OR clause is satisfied and the results from the report are not taken in. If 'Y', the results from the report are taken in. This part is fine.
    The problem is, on the dashboard prompt, there are a few constrained prompts. When these are selected, WHERE clause is attached 'N'='N' (the clause above). So when 'Y' is selected in the prompt, the condition fails and the constrained prompts do not show any results.
    So, basically the idea is: How do I make my report run against 'Filter based on results of another request' when 'Y' is selected and bypass this (i.e. take the other filters) when 'N' is selected (Keeping in mind the constrained prompts).
    Thanks
    Ananth

    Hi
    I searched a little and found the following link
    http://obiee101.blogspot.com/2009/02/obiee-switching-between-filters.html
    This half-solves my problem. The issue is that, the above link uses a example of a dashboard prompt where there is only one 'Yes/No' prompt. What if there is a constrained prompt as well. In that case, when Yes/No is selected, a WHERE clause will be attached to the Constrained prompt (saying 'NO'='YES') and it will show 'No results'.
    Thanks
    Ananth

  • How to update one lov based on value selected from another lov.

    Hi ,
    I have a form in which I created the 2 LOVs for my event_date field and event_name field each which is stored in one table.
    t I want to update the event_date LOV everytime event_name is selected.
    How can I achieve this.
    Thanks.
    Neeti.

    Hi,
    You can do this using dynamic LOVs. Here are the steps for populating a employee LOV on selecting a department.
    1) Create a dynamic lov say emloyee_lov with a bind variable like this
    select empno,ename from scott.emp
    where deptno = :dept
    2) Create a form on scott.emp.
    3) In the empno field which should be a LOV type of field, associate it with
    the above employee LOV.
    4) Then set the binding(s) for the bind variable(s) defined in the lov by
    selecting the deptno column.
    This would help.
    Thanks,
    Sharmila

Maybe you are looking for

  • Gr/ir clearance a/c

    Hi guys, How to clear a GR/IR account manually?  Our requirement is that we have already arranged the payment to vendor by JV.  We want to clear this balance amount from GR/IR a/c. thanks in advance chintu

  • Preference (.plist) files have a black background with black text

    Like the title says. It's not causing any trouble apart from being unreadable, just a little annoying. Any solutions? Is there a plist file that holds information on how other plist files should look? Oh yeah, this is my other Mac- a G4 with 10.5.8.

  • Error: An attempt was made to load a program with an incorrect format. (Exception from HRRESULT:0x8007000b)

    Hi All, I am trying to install 64 bit addon on SAP9 64 bit client. But i am getting following error: Error: An attempt was made to load a program with an incorrect format. (Exception from HRRESULT:0x8007000b) Please give some solution.

  • Major iPod touch crash problem.

    So when running Apps like Safari, Contacts and other random apps, my new iPod touch 4G (fall 2011 version) will crash ALL THE TIME. I tried making a contact twice and it crashed when I hit done, and then I restarted it and it finally worked. Also wha

  • Airplay Not Available on MacBook Pro

    I have upgraded three systems to Mavericks so far, a 2008 MacBook Pro, a 2011 Mac mini, and a 2013 MacBook Air. On the Mac mini and MacBook Air I have the airplay icon on the top menu bar to use with my AppleTV.  On my MacBook Pro, this icon is not t