How to Populate values dynamically in Select Box.

Hi All,
I have few select boxes in my webdynpro application. Right now I am populating them using Harcoded values in the Dictionary. But I dont want to harcode the values in the dictionary, i want pull the values from database tables or  text files of EP KM. Just let me know which is the better way to populate the select box without hardcoding & why ?
Thanks in Advance.
Regards,
Aditya Metukul

Hi Aditya,
Getting values from KM and database is possible
It depends on your requirement
ie if the dropdown should contain details of documents from KM or it should display the details in a table
if it is oracle table see this link
Webdynpro and Oracle
if you want to get data from km see this tutorial
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on using knowledge management functions in web dynpro - 26.htm
Hope this helps you
Regards
Rohit
Regards
Rohit

Similar Messages

  • How to populate optional items in SELECT BOX

    // REGISTRATION.JSP//
    <%@ page import="java.util.Enumeration" %>
    <%@ page import="java.util.Vector" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.lang.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="beans.register2" %>
    <jsp:useBean id="registerbn" scope= "session" class="beans.register2" />
    <% String base = (String) session.getAttribute("base");
    registerbn.setDburl((String)session.getAttribute("dbUrl"));
    registerbn.setDbuser((String)session.getAttribute("dbUserName"));
    registerbn.setDbpasswd((String)session.getAttribute("dbPassword"));
    System.out.println("Inside jsp - setMembers of promotion successful");
    registerbn.setMembers();
    System.out.println("after setting");
    %>
    <%
    String action=request.getParameter("action");
    %>
    <HTML>
    <HEAD>
    <TITLE> TIFR INTRANET </TITLE>
    </HEAD>
    <HEAD>
    <script language="_JavaScript1.2">
    function isIdcode()
    / validating
    function isUser()
    / validating
    function isEmail()
    / validating
    function isPassword()
    / validating
    function isDob()
    / validating
    </javascript> -----java script ends here----------------
    <TD align="top" valign="top"><jsp:include page="menu.jsp" flush="true"/>
    </td>
    <td>
    <table cellpadding="2" cellspacing="3" width="40%">
    <form method="post" action="./beans.register2">
    Fisrt question: we have creaated "register2.java "as beans class for setting the values in to the data base.
    is it correct ?
    <td width="40" align="center"
    <font face="arial" size="5" align="right">
    <b>
    Registration <hr> </hr>
    </b>
    </font>
    <br>
    </td>
    <tr valign="center" width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">IdCode </b> </font>
    </td>
    <td width="40%">
    <b><font face="Arial" size="2">
    <input type="text" name="idcode" size="6" style="border-style:solid" value="">
    </font></b>
    </td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">User </font></B></td>
    <td width="40%">
    <input type="text" name="user" size="12" style="border-style: solid" value="">
    </font></b></td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">Password </font></B></td>
    <td width="40%">
    <input type="password" name="password" size="25" tabindex="20" style="border-style: solid" width="12" value="">
    </font></b></td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">Section code </font></b></td>
    <td width="40%">
    <select size="1" name="section_code" tabindex="9"
    style="border-style: solid">
    <%@ include file="section.txt" %>
    Secound question:
    // inclided simple .txt file here
    // what if new item get enlisted in the database , we have to countinuesly update this .txt file ? so we head for creating simple beans class for retriving values
    then displaying in the SELECT box
    // we dont know how to do it.
    //other html tags //
    ----------------at end -----------------
    <input type="Submit" value="Submit" name="B1" > </td>
    <td width="40%">
    <input type="reset" value="Reset" name="B2"></td>
    <%
    String action=request.getParameter("Submit");
    if(action!=null && action.equals("Submit"))
    try{
    String idcode=request.getParameter("idcode");
    String user=request.getParameter("user");
    String password=request.getParameter("password");
    String seccode=request.getParameter("section_code");
    String Category=request.getParameter("Category");
    String BCategory=request.getParameter("BCategory");
    String Bheads=request.getParameter("Bheads");
    String OtherCategory=request.getParameter("OtherCategory");
    String email=request.getParameter("email");
    String day=request.getParameter("day");
    String month=request.getParameter("month");
    String year=request.getParameter("year");
    String Dob=day+"/"+month+"/"+year;
    String day1=request.getParameter("day1");
    String month1=request.getParameter("month1");
    String year1=request.getParameter("year1");
    String Doj=day1+"/"+month1+"/"+year1;
    registerbn.setIdcode("idcode");
    registerbn.setUser("user");
    registerbn.setPassword("password");
    registerbn.setSec_code("seccode");
    registerbn.setCategory("Category");
    registerbn.setBut_Category("BCategory");
    registerbn.setBut_heada("Bheads");
    registerbn.setOther_Category("OtherCategory");
    registerbn.setemail("email");
    registerbn.setDob("Dob");
    registerbn.setDoj("Doj");
    registerbn.saveData();
    /// saveData() is the one method where we are wrintn query to insert in to database//
    }catch(Exception ex)
    out.println("ERROR :has occured ");
    %>
    </table>
    </table>
    </table>
    </form>
    </td>
    </tr>
    <jsp include page="Footer.jsp" flush="true"/>

    To do that you have to get your recordset, and insert option tags into a while cicle. Something like this:
    <select name="mySelectName">
    <%while(myRecordSet.next()){%>
    <option value="<%=myRecordset.getObject(myField1)>"><%=myRecordset.getObject(myField2)%></option>
    <%}%>
    </select>

  • How to populate values dynamically & allows user to edit some other columns

    Hi..I am new to Apex..please help me to sove it out...
    I have a scenario like editing the some of the Customer details where as one field is dynamically populating from a different table.
    Columns like Include, Frequency, Communication, Address and Exclude has to be displayed in tabular format and data should be stored in a table called "om_customer_catalog ".
    In this "Communication " column value is dynamically populating from a table called "om_customer_settings" and the no. of records in the om_customer_settings table may vary time to time as per the settins in the Admin module.
    I want the user to edit all details except Communication column for all the rows which is displayed and the no. of rows should be displayed dynamically as per the settings.
    how can i achieve this?...which way i need to proceed like whether report kind of thing..or someother way..
    hope some reply....
    More Column details:
    Include - a Check box with editable(values Y or N)
    Communication - text field with display only(values like Promotional Email, All Email etc.)
    Frequecny - Drop downbox with editable(values Annually/Monthly/Weekly etc)
    Address - Drop down with editable(static values like Me, Father, Mother,Brother etc)
    Exclude Reason - text field with editable(any text value)
    Apply - a button for saving the changes
    thanks in advace...
    renjish

    Hello Renjish,
    Solution is quite tricky, You have to make a procedure which select each row of your tabular form and executes the update statement (customized).
    e.g
    to select each row of table use
    begin
    FOR I in 1..APEX_APPLICATION.G_F01.COUNT
    LOOP
    insert into table_name values(APEX_APPLICATION.G_F01(i),'PENDING',sysdate,'RESOURCE','','','','');
    end loop;
    end;
    here APEX_APPLICATION.G_F01(i) will return the value of the first column of selected row. Pick the values and make a cutomized update command.
    Regards,
    bhanwar

  • How to populate values dynamically in dropdownbykey

    Hi All,
    My requirement is to populate the dropdown filled in with values( and key) which are coming from the ZBAPI call ie web service model.
    How do i achieve this ?
    Kindly provide me with some pseudo code.
    Reg/Venkat

    Hi Venkat,
              You can populate dropdown values from webservice using the following steps. I assume you gave idea about custom controller.
    step1:
          Create custom controller.Inside custom controller Bind input value then execute webservice.
    step2:
          Now you have value node which is returned from web service. find thr size of value node.  
    After execute web service you can find size using the following code. create value node and model node object using the code.
    Step3:
    <custom controller name>.IRole_ResultNode modelnode=wdContext.nodeRole_Result();
    <custom controller name>.IRole_OutputNode valuenode=wdContext.nodeRole_Output();
    valuenode.invalidate();
    int size=modelnode.size();
    Step4:
         After find size using loop fetch values from model node into value node.Asume in this value node contains key and value.
    for(int x=0;x<modelnode.size();x++){
    <custom controller name>.IRole_ResultElement  modelElement=modelnode.getRole_ResultElementAt(x);
    <custom controller name>.IRole_OutputElement valueElement=wdContext.createRole_OutputElement();
    valueElement.setId(modelElement.getKey());
    valueElement.setText(modelElement.getValue());
    valuenode.addElement(valueElement);
    step5:
    After that bind this value node(Role_Output) into Component controller. Then Bind value node(Role_Output) from component controller into view.
    Step6:
    Finally bind dropdown UI Element into Role_Output node's attribute(ID).
    Kind Regards,
    S.Saravanan

  • How to populate values into a Listbox on selection screen

    Hi All,
    Please any one let me know how to populate values (for ex.01,02 and 03) in a list box of selection screen..
    Thanks,
    Vijay

    Try this code ...
    REPORT  ZLISTBOX.
    TYPE-POOLS: VRM.
    TABLES SPFLI.
    TABLES SSCRFIELDS.
    DATA flag.
    DATA: NAME TYPE VRM_ID,
    LIST TYPE VRM_VALUES,
    VALUE LIKE LINE OF LIST.
    PARAMETERS PS_PARM LIKE SPFLI-CARRID AS LISTBOX VISIBLE LENGTH 5
    USER-COMMAND fcodex.
    data: i_spfli type spfli occurs 0 with header line.
    PARAMETERS PQ_PARAM LIKE SPFLI-connid AS LISTBOX VISIBLE LENGTH 15
    USER-COMMAND
    fcodey.
    *DS AS CHECKBOX USER-COMMAND FLAG.
    INITIALIZATION.
    NAME = 'PS_PARM'.
    DATA T TYPE I VALUE 0.
    SELECT DISTINCT carrid into corresponding fields of table i_spfli FROM
    SPFLI.
    loop at i_spfli.
    VALUE-KEY = i_spfli-CARRID.
    VALUE-TEXT = i_spfli-CARRID.
    APPEND VALUE TO LIST.
    endloop.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = NAME
    VALUES = LIST.
    AT SELECTION-SCREEN.
    if sy-ucomm eq 'FCODEX'.
    REFRESH LIST.
    CLEAR LIST.
    PQ_PARAM = ' '.
    NAME = 'PQ_PARAM'.
    SELECT * FROM SPFLI WHERE CARRID = PS_PARM.
    VALUE-KEY = SPFLI-connid.
    VALUE-TEXT = SPFLI-connid.
    APPEND VALUE TO LIST.
    ENDSELECT.
    endif.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF SY-UCOMM NE 'FCODEX' OR SY-UCOMM NE 'FCODEY'.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = NAME
    VALUES = LIST.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    START-OF-SELECTION.
    clear i_spfli.
    refresh i_spfli.
    select * into table i_spfli from spfli where carrid = ps_parm and connid
    = pq_param.
    loop at i_spfli.
    WRITE: / 'CITY FROM:', I_SPFLI-CITYFROM, 'CITY TO :',I_SPFLI-CITYTO,
    'DEPARTURE TIME :', I_SPFLI-DEPTIME.
    ENDLOOP.

  • How to populate values in List Box in Adobe form

    Hi,
    How to populate values in List box in adobe forms?
    Thanks
    RB

    if you want to display a fixed values in the dropdown you can use list box ui and can specify values there
    or if u want to display values from the context node of the webdynpro
    1. Drag and drop a Value Help Drop-down List element from the Web Dynpro Library tab to the Body Pages pane.
    2. Drag and drop your node from the Data View tab onto it. This action binds the layout element to the corresponding node.
    with regards
    shanto aloor

  • How to get value of html combo box (i.e select) in jsp?

    Hello,
    I was just wondering how to get value of html combo box in jsp page. My code for combo box is:
    <select name="combo" size="1">
    <%
    List<Project> projects = mgr.getProjects();
    for(Project project : projects){
    %>
    <option value="<%= project.getId()%>"><%= project.getName()%></option>
    <%
    %>
    </select>
    I thought combo.value might give me the value, but it throws exception.
    Any help is appreciated.
    Thanks.

    The combo does not exists in Java, but only in HTML. You have to submit the form containing the combo and then use request.getParameter("combo") to get it's value ;-)

  • How can I validate a multi-select box to have at least 1 option

    How can I validate a multi-select box to have at least 1 option
    selected in struts?

    thanks i will try that other then that if I want to create single drop down list and pass multiple values associated to that drop list value how would i do that....

  • How to populate values for a new field in target infoprovider

    Hi Experts,
    am new to BI. i would like to know on how to populate values for a new field in the target cube with start rotuine.In my case,  i have a source infoprovider, which has 3 fields and a target infoprovider, which has 5 fields. i need to populate the new 2 fields in start routine. i dont want to populate using Field routine and am using 3.5 version. please assist with code on how to solve this issue.
    Thank you,
    Chitra.
    Edited by: Chitra_BI on Jun 13, 2011 10:23 AM

    Debug the standard code and see where the other fields are getting update. you can use the similar approach and area to code for the new field.
    Regards,
    Lalit Mohan Gupta.

  • How to populate data dynamically in WSelect web element.

    How to populate data dynamically in WSelect web element. what is the syntax of WSelect web element to populate data from the database

    Hi Jamie,
    There is no Url to download ackage, instead the link is taking here
    Crystal Reports webElements
    Can you give me correct link?

  • How to populate one dropdown on select of other dropdown in a table

    Hi
    My requirement is that I want to populate one dropdown on selection of some value in other drop down.The two dropdown are present in two columns of a Table.
    Can any body help for the same.
    Regards
    Nitin

    Hi,
    Try This
    Bind "enable" properties of Both DD1 and DD2 to
    context attributes of type boolean. DD1Enable,DD2Enable
    1: set their value to false intially 
      wdContext.currentContextElement.setDD1Enable(false);
      wdContext.currentContextElement.setDD2Enable(false);
      Bind the selected property of the table to a
      Context attribute of type boolean(Initially false), say "selected"
    2: Then use check box in the table to get current lead selection
      write in "onToggle" action  of checkBox
    int len=wdContext.nodeTable().size();
    for(int i=0;i<len;i++)
             if(wdContext.currentTableElement().getSelected()==true)
                 wdContext.currentDD1Element().setDD1Enabled(true);
                 wdContext.currentDD2Element().setDD2Enabled(true);
             }else
         wdContext.currentDD1Element().setCountryEnabled(false);
         wdContext.currentDD2Element().setStateEnabled(false);
    This is how u get leadselection and able to change particular row in the table
    Regards
    Lakshmi

  • Populate the JSP's select box from database on jsp load

    hai all,
    can any one help me in knowing how to populate the select box of a jsp
    with data from the database?
    thanks and regards,
    ravikiran

    <%
    String sQuery = "select id,Name from tablename";
    rs = stmt.executeQuery(sQuery);
    %>
    <select name="sltName">
    <%
    while(rs.next()){
    String sId = rs.getString(1);
    String sName = rs.getString(2);
    %>
    <option value="<%=sId %>" > <%=sName %> </option>
    <%
    %>
    </select>

  • How to update database with a select box

    I'm hoping someone can/will help me with a new feature I'm
    trying to add to my web site. I'll summarize what I'm working with
    and then proceed to what I'd like to do. This is the web site I'm
    working on: www.truckerstoystore.net
    I have a database for the Truck of the Week set up with the
    information that is output on each page in the left column and
    on the Truck of the week page itself. I add new Truck of the
    Week (TOW) entries via a form I've put together. Right now, in
    order to change the current TOW, I have to manually go into my
    template and change the ID (which is automatically assigned when
    the record is created, and thus makes it unique) in my SQL which
    currently reads
    SELECT *
    FROM truckofweek
    WHERE ID="4"
    to the ID of the current TOW.
    What I want to be able to do is create a new form that will
    allow me to select the TOW entry that I want to be displayed from a
    select box (drop down box). I have a good idea of how to populate
    my select box, but don't know how to get it to work. My first idea
    was to update the table in the database (Access) manually with a
    new column called currentTOW, with values set to a Yes/No type,
    with default values set to "No". Then I would use my form to set
    the value for one of them to "Yes" so I could set my SQL to 'WHERE
    currentTOW ="yes" ' I would also make a <cfif> statement that
    checks for entries marked "Yes" and changes them to "No" when the
    form loads to avoid setting 2 entries to "Yes" and my page thus
    attempting to load 2 TOW entries.
    My problem is, I don't know how to do any of this. I hope
    I've described this situation well enough. I know there has to be
    at least one guru on here that can help me. Any assistance would be
    greatly appreciated.

    Hey,
    Thanks for replying. That sounds like a good idea, but I
    don't know how to do it.
    I started working on a new idea, where I have a second table
    in the same datasource set up called currentTOW, with one field
    called currentTOW and only one record. The idea is to send the
    string of the "owner" field from the select box, which is populated
    from the table called truckofweek to this one cell in the
    currentTOW table.
    This way, in my page which will display the data, I have 2
    querys. The first pulls the data in the single cell from currentTOW
    and outputs its string into the second query. I've attached the
    code below. I get an error when I try to display the page, see the
    error here:
    www.truckerstoystore.net/currentTOW2.cfm.
    However, the SQL looks like I want it to look, as "WHERE Owner =
    Craig Carp" is essentially the same record that it displays now in
    the live page "/currentTOW.cfm" only the SQL currently reads "WHERE
    ID = 4" (4 and Craig Carp are part of the same record).
    Here is the link to my form:
    Form

  • How to populate values in listbox of a field?

    HI all,
    My requirement is : i have one filed , for that i have five values,
    i want to display those five values in the list box. then i have to select one of them  and based on this field i have to display few fields in table control .
    here i am able to display the values in listbox but even i select any value , it showing the first vale only !!!!!!
    please help me in this regard.

    This is the way........
    DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
      DATA : L_PSPNR  TYPE PROJ-PSPID,
             L_WBSE   TYPE PRPS-POSID.
    PARAMETERS : P_BPO TYPE CKIS-EXTNR
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BPO.
    DATA : BEGIN OF IT_BPO OCCURS 100,
             BPO LIKE ZCKIS-BPO,
             END OF IT_BPO.
      DYNFIELDS-FIELDNAME = 'P_PSPNR'.
      APPEND DYNFIELDS.
      CLEAR DYNFIELDS.
      DYNFIELDS-FIELDNAME = 'P_WBSE'.
      APPEND DYNFIELDS.
      CLEAR DYNFIELDS.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          DYNAME               = SY-CPROG
          DYNUMB               = SY-DYNNR
          TRANSLATE_TO_UPPER   = 'X'
        TABLES
          DYNPFIELDS           = DYNFIELDS
        EXCEPTIONS
          INVALID_ABAPWORKAREA = 1
          INVALID_DYNPROFIELD  = 2
          INVALID_DYNPRONAME   = 3
          INVALID_DYNPRONUMMER = 4
          INVALID_REQUEST      = 5
          NO_FIELDDESCRIPTION  = 6
          INVALID_PARAMETER    = 7
          UNDEFIND_ERROR       = 8
          DOUBLE_CONVERSION    = 9
          STEPL_NOT_FOUND      = 10
          OTHERS               = 11.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
    Rewards if satisfied
    Thanks

  • How to populate table rows with selected listbox items?

    Hello,
    I am trying to populate a table with selected listbox items. Each item should be a new row in the table. The picture below is the listbox and table I am using. I need to get the selected name to populate the Attendee column of the table when the user clicks the Add button. How do you do this with mutltiple attendees selected?
    Thank you,
    Angie

    So you're considering the fact the if the user clicks the button twice, the name will appear twice and you don't want this, right?
    Then you must check if any value is the same than the one you are about to add in the row..
    for (var i = 0 ; i < ListBox1.length; i++){
         if (ListBox1.getItemState(i) == true){
              for (var x = 0 ; x < Table1._Row1.count; x++){
                   var boNewAttendee = true;
                   var strAttendee = Table1.resolveNode("Row1[" + x.toString() + "]").txtAttendee;
                   var newAttendee = ListBox1.getDisplayItem(i);
                   if (strAttendee.rawValue == newAttendee){
                        boNewAttendee = false;
                        break;
              if (boNewAttendee){
                   txtAttendee.rawValue = ListBox1.getDisplayItem(i);

Maybe you are looking for

  • Error while doing migo PO not yet release

    Hi experts, While doing posting in Migo for a PO . it showing error "Purchasing document not yet released." But i have already released. and while seeing the header details in ME22n, it showing as released. pls help regards arun

  • Using a Heiarchical Tree with data that can be grouped

    Hello Forum I have been tasked with coming up with a selector for one of our applications that uses a tree. I have built a mock-up using the example provided at Craigs Oracle Stuff (https://sites.google.com/site/craigsoraclestuff/oracle-forms---how-t

  • SD Process Design for Plantation industry - need advise

    Hi all experts, I am implementing for a crude palm oil plantation company, in which the general flow of the sales process from Estate to the Milling Plant is as below: Sales Order --> Delivery Order* --> PGI --> Billing* Sales Order: The fresh fruit

  • Trying to use email

    Two questions I need some help with. 1- with my Curve a was able to go online and manage my email filters I have verizon and I just had to login to Blackberry.com/go/vzw. it would let me do this from my deaktop am i missing something? 2- I cant get m

  • Cartesian time data across multiple hourly rows

    Looking for a solution for exploding time rows into multiple rows by hour. For example, take a row like this: EventTime         EventLengthSeconds 2014-04-25 13:31:16.857 6657 What I need is multiple rows to allocate the time by hour like this: Event