Populating dropdown

Hi,
I have a view in which there are fields with the dropdown(Year, month and date). I have to populate them , please let me know how to do that. Any pointers will be of great help.
Regards,
Ashutosh

HI,
You can either have Drop down by key or dropdown by index.
Following are the ways to populate them :
DropDownBy Key :
     Here we have two things Value and a Key. Value is shown in the Drop down.
     Node used is For_Drop and Attribute is u2018Drop_Keyu2019.
method WDDOINIT .
  DATA : node_info TYPE REF TO if_wd_context_node_info,
         value1 TYPE wdy_key_value,
         set TYPE wdy_key_value_table,
         k1 type string value 'M',
         v1 type string value 'MAGO',
         k2 type string value 'S',
         v2 type string value 'Saurav'.
  value1-key = k1.
  value1-value = v1.
  APPEND value1 to set.
  value1-key = k2.
  value1-value = v2.
   APPEND value1 to set.
node_info = wd_context->get_node_info( ).
node_info = node_info->get_child_node('FOR_DROP').
node_info->set_attribute_value_set( name = 'DROP_KEY'   value_set = set ).
endmethod.
DropDown By Index:
     Value passed into internal table.
     Internal table is finally binded with the corresponding node(Context)
method WDDOINIT .
  data : it_table type STANDARD TABLE OF sflight.
    DATA lo_nd_cn_drpindex TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_drpindex TYPE REF TO if_wd_context_element.
    DATA ls_cn_drpindex TYPE wd_this->element_cn_drpindex.
  navigate from <CONTEXT> to <CN_DRPINDEX> via lead selection
    lo_nd_cn_drpindex = wd_context->get_child_node( name = wd_this->wdctx_cn_drpindex ).
select carrid from sflight into CORRESPONDING FIELDS OF TABLE it_table.
  lo_nd_cn_drpindex->bind_table( it_table ).
endmethod.
Dropdown is binded with CN_DRPINDEX context node.

Similar Messages

  • {module_billingcountry} Not populating dropdown

    Hi,
    I have this module in a web form which should be populating the dropdown when a user is logged into a secure zone. However it can't select the correct country form the dropdown - it was taking the selected option. I removed the selected option so the default was Please Select but the module is not pulling in the information.
    Can anyone help? Is there a work around for this?

    Hi,
    In the form have u used the binding tab to attach the value from the table filed to the field on the layout.
    Regards,
    sasi
    can you send me the form to my id to check. [email protected]

  • Dynamically populated dropdown values are missing when instances are added

    HI Team
    I have a subform which is repeatable have  a drop down  as one of the field which is dynamically populated from the web service call(short lived process) from the DB.On initialize event of the subform the data connection is executed .Dropown is populated with the values but when an instance of subform is added the dropdown values are missing.
    Only in the first instance of a subform  dropdown values are showing up , when instances of subform is added the drop down values are missing.
    Please let me how can i solve this issue,
    Thanks in Advance
    Bharathi

    I've tried this option by adding some value (hard-coded) during initialize event of the subform and all values are populated in the newly added instances as well.
    Not sure why it's not working for you.. Can you try adding some sample values without calling web service and confirm if it's working?

  • Regarding populating dropdowns

    Hi All,
    I am using two dropdowns(dropdown by key) in my application. One is used to populate a/c numbers and the other for a/c names.
    Both the dropdowns get populated from a BAPI.
    The problem is:
    When I select a a/c number in a dropdown, the corresponding a/c name should be automatically selected in the a/c name dropdown. Also, if i select a a/cname in the dropdown, then the corresponding a/c number should get automatically selected in the a/cnumber dropdown.
    Is it possible in Webdynpro???
    If so, How could I do that???
    Please help me in this context.
    Also, suggest me if there is any other solution for this.
    Regards,
    Murthy.

    Hi,
    <b>If you take DropDownByIndex...</b>
    Take one Context Node "Account" and create two value attributes in that node.
    one for "Account Number" and one for "Account Name".
    Insert the data coming from BAPI into this node.
    Then bind account name attribute attribute for first dropdown list and account number attribute for second dropdown list...
    this will solve your problem.....
    <b>If you take DropDownByKey..</b>
    then create on simpletype ...for example "valuestype".
    Then create one value attribute "values" of type that simple type "valuestype"
    then insert values into attribute "values" using the following code...
    ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("values");
    IModifiableSimpleValueSet values=myType.getSVServices().getModifiableSimpleValueSet();
            values.put("account number 1","account name 1");
                       values.put("account number 2","account name 2");
    like this...
    After that take one DropDownByKey and InputField Ui elements...
    and bind value attribute to those ui elements....
    this may solve your problem...

  • Populating dropdown column in a table.

    Hi,
    I have tied an ODataModel with a table. In the table one of the columns is dropdown list. The list has some 3 values. It's slightly confusing for me but how to go with such scenario? Do I have to tie another model consisting of the values I want in the dropdown and then have it's property bound to the response coming from the ODataModel which is tied to the table?
    Is the following thing correct? but it may not be good if I have more values to be there in the dropdown and morever.... how to proceed if I want to bind this "key" mentioned below with "Status" in the ODataModel? Here I have tied the "value" property of combobox to the "StatusText" coming from ODataModel.
    But I want to tie the "key" property of ListItem with "Status" from ODataModel(which is tied with the table) response
    oTable.addColumn(
    new sap.ui.commons.ComboBox({
    items: [
                                      new sap.ui.core.ListItem({text: "New",key:"1"}).bindProperty("text","StatusText").bindProperty("key","Status"),
                                      new sap.ui.core.ListItem({text: "In Process",key:"2"}),
                                      new sap.ui.core.ListItem({text: "Completed",key:"3"})
                                  }).bindProperty("value","StatusText")
    Any Help would be appreciated.
    Thanks,
    Supriya Kale

    Hi,
    I think defining another model is not required.
    Just create the service to return the data in the required format.
    I will give an example using a Json model.
    Say I have a model something like this :
    var aData = [
             {country: "Germany", places:[{name: "Heidelberg", prio: "1"},{name: "Munich", prio: "2"},{name: "Berlin", prio:"3"}] }
    You can define a column template as a ListItem and bind the data from the model.
               var oListItem = new sap.ui.core.ListItem();
               oListItem.bindProperty("text","name");
               var oColumn = new sap.ui.table.Column({
              label: new sap.ui.commons.Label({text: "<<Column text>>"}),
              template:  new sap.ui.commons.ComboBox().bindItems("places",oListItem)
    Providing a working example here.
    http://jsbin.com/veqeza/9/edit
    Hope this helps.
    Regards,
    Aditya

  • Populating dropdown list with entries in multiple text boxes?

    I'm creating a form that needs to be simple to use and complete.  I would like to be able to populate a drop-down list with entries the user puts into text boxes.  Can this be done?
    For more detail:
    In one location is a table, the use will type into a text box a Project Name, then other information such as location and total acres.
    In another location I've got a table where the user will enter the offerings from each project they listed in the 1st table.  It is a long table as it is, I cannot combine the two (will not fit on one page if I do combine them). 
    Instead of making the user type in the project names multiple times, I'd like to be able to take the project names the users input (from table one) and have those entries automatically populate the dropdown list in the second table.
    Any suggestions would be greatly appreciated!!!

    Not exactly a find and replace but you can do it.
    Select the text frames yu want to change the colors using the shift key to click select the frames.
    Then go to Edit>Edit Color>Recolor Art
    You wll see a dialog with red and black bars along side two shorter bars click the shorter bars to select a New Color a color picker will appear you can use the swatches or the color mixer.
    There is a live preview /so you will see the change in case you want to pick a different gray, of course you can always go back to the recolor art dialog.
    I am afraid you manually have to select text frames with multiple colors in order to accomplish what you want but the method above I believe is the only want to change the colors.
    This video shows how the dialog works but pretend the one frame I did not select is another color.
    http://www.wadezimmerman.com/videos/RecolorText.mov

  • Populating dropdown list from an XML file

    Hi!
    I want to prepopulate a dropdown list in a form from an XML file.
    Typically something like:
      A
      B
      C
    Is this the correct way to specify the list's values in XML?
    How do I specify the binding property of my dropdown list, to put the values A, B and C into the dropdown list?
    I am using Designer 7.0!
    Thanks!

    [email protected] wrote:
    > Hi!
    >
    > I want to prepopulate a dropdown list in a form from an XML file.
    > Typically something like:
    >
    >
    >   A
    >   B
    >   C
    >
    >
    >
    > Is this the correct way to specify the list's values in XML?
    > How do I specify the binding property of my dropdown list, to put the values A, B and C into the dropdown list?
    >
    > I am using Designer 7.0!
    >
    > Thanks!
    Liana,
       You can't do this with Designer 7.0.  If you upgrade to Designer 7.1,
    you can bind dropdown list values to your xml data using the dynamic
    property binding capabilities.
    Hope this helps!
       Justin

  • Populating dropdown with Map rule

    Hey,
    I am currently getting a list of users that belong to an admin role and looking up the individual fullnames to create a map to display the name in the dropdown but pass the accountId once the form is submitted. My rule is below however the result of my rule currently gives me this:
    <List>
    <Map>
    <MapEntry key='id1' value=name1'/>
    </Map>
    <Map>
    <MapEntry key='id2' value='name2'/>
    </Map>
    </List>
    I really just want something like this so i can put it in the valueMap property in a dropdown:
    <Map>
    <MapEntry key='id1' value='name1'/>
    <MapEntry key='id2' value='name2'/>
    </Map>
    Any ideas how i need to change my rule below:
    <block>
    <defvar name='idList'>
    <invoke name='getUsers' class='com.waveset.ui.FormUtil'>
    <ref>:display.session</ref>
    <map>
    <s>conditions</s>
    <map>
    <s>adminRoles</s>
    <s>Role</s>
    </map>
    </map>
    </invoke>
    </defvar>
    <dolist name='entry'>
    <ref>idList</ref>
    <map>
    <ref>entry</ref>
    <invoke name='getAttribute'>
    <invoke name='getObject'>
    <ref>:display.session</ref>
    <s>User</s>
    <ref>entry</ref>
    </invoke>
    <s>fullname</s>
    </invoke>
    </map>
    </dolist>
    </block>

    Try:
    <block>
    <defvar name='idList'>
    <invoke name='getUsers' class='com.waveset.ui.FormUtil'>
    <ref>:display.session</ref>
    <map>
    <s>conditions</s>
    <map>
    <s>adminRoles</s>
    <s>Role</s>
    </map>
    </map>
    </invoke>
    </defvar>
    <defvar name='retMap'>
    <new class='java.util.HashMap'/>
    </defvar>
    <dolist name='entry'>
    <ref>idList</ref>
    <set>
    <ref>retMap</ref>
    <ref>entry</ref>
    <invoke name='getAttribute'>
    <invoke name='getObject'>
    <ref>:display.session</ref>
    <s>User</s>
    <ref>entry</ref>
    </invoke>
    <s>fullname</s>
    </invoke>
    </set>
    </dolist>
    <ref>retMap</ref>
    </block>

  • Webdynpro populating dropdown values programmatically

    Hi Friends,
    I knwo how to populate dropdown using simple type, and providing valeus there.
    How to do it programmatically to populate the dropdown values, instead of hardcoding the values?
    Thanks
    Nav

    Hi,
    Check ythis working code in case of node with attribute.
    Let the structure is
    node1
    |                 
    |att1
    Let the cardinality of the node is 1:1 or 1:n
    IWDNode n=wdContext.getChildNode("node1",0);
         IWDNodeInfo nf=n.getNodeInfo();
         IWDAttributeInfo attributeInfo =nf.getAttribute("att1");
         //wdComponentAPI.getMessageManager().reportSuccess("AttributeInfo:"+attributeInfo);
         ISimpleTypeModifiable countryType = attributeInfo.getModifiableSimpleType();
          IModifiableSimpleValueSet valueSet = countryType.getSVServices().getModifiableSimpleValueSet();
           for (int i = 0; i < 40; i++)
              valueSet.put("ID"i,"Customer"i);
    Regards,
    Vijayakhanna Raman

  • Issue in populating dropdowns in Visual Composer

    Hello Experts,
    I am currently trying to push application development using Visual Composer 7.0. Came across certain issues which we were unable to resolve:
    1) We have an RFC which gives 10 return tables. We need to fill the data from these tables into respective drop down fields in a form. Now im unable to bind the table to a drop down directly, so is there a way to do it using some operator etc. because if we try to populate each drop down field seperately as many number of RFC calls are made which slows down my application drastically.
    2) Other issue is pertaining to concentric drop downs. I need to create drop down fields in my application which interdependent, for example if i select a country lets say India then in my City drop down only indian cities should appear. The RFC is providing the foriegn key relationship in the output.
    Please help as these issues are causing bottleneck in application development.
    Best Regards
    Gaurang

    I did PERFORM write_form USING 'ITEM' ' ' ' ' 'MAIN'.
    with following code and its not coming... it is showing only last line of that internal table into sap-scripts o/p
    FORM write_form USING p_element
                          p_function
                          p_type
                          p_window.
      CALL FUNCTION 'WRITE_FORM'
          EXPORTING
               element                  = p_element
    *            function                 = p_function
    *            type                     = p_type
               window                   = p_window
    *       IMPORTING
    *            PENDING_LINES            =
           EXCEPTIONS
                element                  = 1
                function                 = 2
                type                     = 3
                unopened                 = 4
                unstarted                = 5
                window                   = 6
                bad_pageformat_for_print = 7
                OTHERS                   = 8.
    ENDFORM.                               " WRITE_FORM

  • Data population in a dropdown inside a Table in WebDynpro Java

    Hi All ,
    I have a table inside which there is a dropdown in a ZCI Form. I am using enumerated dropdown list.
    The issue is binding of this dropdown is not woking as it works for normal dropdown.
    I am getting pdfdocumentcreation exception if trying to bind this dropdown using dynamic binding.
    Anybody help me out to solve this issue.
    regards
    Ravindra

    Hi,
      Refer the below link you will get useful information
    Dropdownlist to display r3 table
    Re: DropdownList box to display R/3 table
    see this link for when to use DropDownByIndex (DDI) vs DDK (DropDownByKey) and how populate data from R/3.
    Re: webdynpro populating dropdown values programmatically
    create context value attribute and bind to drop down by key
    not getting value from DropDownByKey
    Dynamically adding values to dropdown by key thread
    Dynamicaly adding values to DropDownByKey
    Dropdown by key
    dynamic DropDownByKey
    http://help.sap.com/saphelp_nw04/helpdata/en/4a/8613e41629344194e4f40393740d51/content.htm
    Regards,
    Saraswathi.
    Pls reward points for useful info
    Message was edited by: Saraswathi D

  • Populating values in dropdown fields on interactive adobe forms.

    Hi,
    In HCM Forms & Process, I have populated dropdown fields using generic service. But today I came to know we can also populate the dropdown field values using webdynpro lookup tables. First question, Is that a wrong method to populate the dropdown field values using generic service. Second question, If I populate the dropdown field values using lookup tables does the performance will increase when compared to populating from generic service. Please let me know.
    Regards,
    Nayani.

    Hi,
    In HCM Forms & Process, I have populated dropdown fields using generic service. But today I came to know we can also populate the dropdown field values using webdynpro lookup tables. First question, Is that a wrong method to populate the dropdown field values using generic service. Second question, If I populate the dropdown field values using lookup tables does the performance will increase when compared to populating from generic service. Please let me know.
    Regards,
    Nayani.

  • Use dpendent dropdowns in dataTable

    The problem is how to populate/refresh the item list of a dropdown menu in a row af a dataTable according to the changes of an other component in the same row.
    As an example consider the case when the rows of the table corresppond to Project entities, and for each project we can assign a departement and a project leader among the employees of the selected departement. NOw if the user select a departement for a project then the dorpdown for project leader should be populated with the employees of the selected departement.
    I had two ideas but unfortunately none of them works. The first one is to generate the list of SelectItems in the Project entity (not a good programming practice). That is
    <f:selectItems value="#{project.projectLeaderSelect}">so in the getProjectLeaderSelect() method of the entity we have information about the selected project leader.
    The problem of this solution that the JSF framework does not allows us to bind input elements to none managed bean properties. I got exception - I suspect that was the reason.
    The other way would be to send request parameters when populating dropdowns, but unfortunately getters are called several times, and the sent request parameters may be not living at any call.
    At the end I solved the problem a bit strange way. I generated a prepopulated project leader dropdown for each possible departement, and rendered only one according to the present value of the departement attribute of the project. Of course, it is not a general enough way but for our problem was working, the possible values of both dropdowns were static.
    I am still looking for a better solution.

    Hi,
    Please go through the sample application AppModel which is available at:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
    Hope this helps.
    Thanks,
    RK.

  • Approaches for Prepopulating dropdowns in Jsp using struts.

    Hi,
    I'm having a functionality working of pre-populating dropdowns using struts like:
    ArrayList list = getRoles(); //This method will return list of roles
    request.setAttribute("roles", list);
    By setting this collection in the request it will be availbel to <html:select and <html:options> tags for pre-populating. My question here is do we need to set the list (that is to be displayed in the JSP) in request scope deliberately, or there are other better approaches as well to do the same, like using expression language and accessing the method directly.
    Thanks,
    Prashant.

    Why dont you use ActionForm.
    declare a private variable
    //variable
    private List roles=null;
    //methods
    public List getRoles();
    public void setRoles(List roles);and in ActionClass
    ArrayList list = getRoles(); //This method will return list of roles
    form.setRoles(list);This collection object will be available in the jsp forwarded from that action in the scope specified in the struts-config.
    then use
    <html:select>
    <html:options collection="roles" labelProperty="name"     property="id" />
    </html:select>

  • Mutually Exclusive DropDowns

    Hi, All:
    I am working on a form in which I need to have a user rate four items from 1-4 in comparison to each other. Initially we were going to use 4 drop downs each drop down containing the four options allowing the user to choose. The problem is, of course, that the user could choose option 1 four times in a row. So I need some way to allow the user to rate these four items from 1 - 4 but in a mutually exclusive manner. the image below shows the problem (they're in spanish but the text isn't important). Here item 1 and item 4 were both selected as 1 which is what we want to prevent. Any suggestions would be greatly appreciated. Thanks.

    Hi,
    You could have a script in the preOpen event of all of the four dropdowns that would set the display items, depending on the previous selections in the other dropdowns.
    There is an example here for populating dropdowns: http://assure.ly/jcTahK.
    Give this a try in the preOpen event of DropDownList1:
    // Remove items previously selected
    this.deleteItem(DropDownList2.selectedIndex);
    this.deleteItem(DropDownList3.selectedIndex);
    this.deleteItem(DropDownList4.selectedIndex);
    Hope that helps,
    Niall

Maybe you are looking for