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

Similar Messages

  • 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 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

  • 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 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 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 Report for Fields

    Hi Experts,
    I have a Report requirement where in I need to Populate values for FROM Period & TO Period based on the user i/p for Quarter variable.
    For Eg;
    Fiscal year : 2009
    Quarter : 3
    Mat     Year         From period    ToPeriod          QTY
      A      2009            07                  09                1
      B      2009            07                  09                22
      C      2009            07                  09                44
    There are no fields FROM Period or TO Period in Cube.I need to populate them in the report directly.
    Please give some inputs to goahead.
    Thanks
    Ravve
    Edited by: ravve king on Jun 4, 2009 4:38 PM
    Edited by: ravve king on Jun 4, 2009 4:39 PM

    You're going to need to create a User Exit in your query. Here's a link to a helpful document on how to do that:
    [Using Customer Exit Variables in BW/BI Reports Part - 1|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f119d9-922d-2c10-88af-8c016638bd90]

  • How to populate value node with values?

    Hi Experts,
    I have created a new view with a vlaue node of table type.
    How can I populate values into the value node?
    Which method will be useful?
    Is there any material for Web UI Programing?
    Please help me in this.
    Thanks,
    Adi.

    Hi Adi
    If ZVal is your value node then,
      DATA: lref_entity    TYPE REF TO cl_bsp_wd_value_node,
            lref_bo_coll   TYPE REF TO if_bol_bo_col,
            lref_data TYPE REF TO <<your ZStructure>>,
             ls_data type <<your ZStructure>>.
    ls_data-<<field1>> = 'XYZ'
    ls_data-<<field2>> = 'XYZ'
         CREATE OBJECT lref_bo_coll TYPE cl_crm_bol_bo_col.
          CREATE DATA lref_data.
          CREATE OBJECT lref_entity
            EXPORTING
              iv_data_ref = lref_data.
          lref_entity->set_properties( ls_data ).
          lref_bo_coll->add( lref_entity ).
          typed_context->ZVal->set_collection( lref_bo_coll ).
    Hope this was helpful.
    Best Regards,
    Lakshminarayana

  • How to populate values in to dropdown in table ui element

    Hi,
    according to my scenario  i have atable with five records ...andi have acolumn name DATE and  it contains 5 dropdowns with some values i.e dates from jan 1 2008-dec 31 2008.user needs to select only those values which are in dropdown. can u tell me the code to populate values in to dropdown in table UI element.
    Thanks
    Raju

    Hi,
    you can go for two drop downs like DropDown by Key or Drop Down by Index as per requirment.
    Create context Node for the table UI, in that one will be for ur drop down. Create element for the Context node and add thses to the conetxt.
    Code example for DropDownBy Key:-
    ISimpleType simpleType =               wdContext     .nodeProjEstiTable().getNodeInfo()
         .getAttribute("projphasname")               .getModifiableSimpleType();
    IModifiableSimpleValueSet svs1 =
    simpleType.getSVServices().getModifiableSimpleValueSet();
    svs1.clear();
    for (int j = 0; j < projphasname.length; j++) {
         svs1.put(projphasname[j][1], projphasname[j][1]);
    for DropDownBy Index you can work in normal way means try to create element for the respective context attribute.
    Hope this may help you...
    Deepak

  • How to populate a dynamic table according to the choice of the viewer

    Hi there,
    I ran into a dead-end on my  "Events" page.
    There is a dynamic table getting the info from a database. It will initially show the Upcoming Events.
    At this point my question is this:
    *Can I populate the dynamic table based on a condition where the current date and the event date (as in the db) will be compared and if the event date is later than the current date, it will be displayed in the table. Otherwise, it won't.
    If I can do that, can someone please help me out with the code?
    Besides that, on the right side of the page there are 3 options for the viewer:
    1. View upcoming events
    2. View past events
    3. Search events by month and year
    What I want to do is that when the viewer clicks on 'past events', the table will be reset and populated with those events whose date has passed.
    When the viewer clicks on "upcoming events", the table is reset again and populated with the relevant events.
    When the viewer selects a month and a year, search the database to find the relevant records.
    Can all of this be written in php? Since I read smwhere that php doesn't work with onclick functions... i got confused. Cuz the data in my table will have to vary depending on what the viewer is clicking (upcoming events/past events/search events). I do not wish to create separate pages for each type of event.
    If anybody has a better suggestion to carry out this task, please share!
    Thanks!

    >Can I populate the dynamic table based on a condition where the current date and the event date (as in the db)
    >will be compared and if the event date is later than the current date, it will be displayed in the table. Otherwise, it won't.
    Of course. You just need to compare the date field in your database with the current date as returned by your DBMS date function. Assuming you are using MySQL, you would compare your column with the currdate() function and use the appropriate greater than/ less than operators in the SQL WHERE clause. If you don't know what a WHERE clause is then I would urge you to learn SQL as soon as possible. You can't build data driven sites without a basic understanding of SQL.
    >Since I read smwhere that php doesn't work with onclick functions..
    What this means is that php is a server side language, where user interactions always occur at the client site. But that does not mean you can't invoke a server side action from a client side event. You most certainly can and would.
    You might consider adding links to the dynamic table page that pass a querystring to the php script which determine what filter to add in the WHERE clause- greater than the current date, less than, etc.
    Also, in the future, please post these questions to the application development forum.

  • How to populate values in dropdownbykey in webdynpro

    I have a scenario where I have to populte data in the dropdownbykey element, select and then submit .
    How do you first insert data from database into the dropdown list ?
    Kindly help me out by providing the steps.I am new to webdynpro.
    Thanks n regards

    Hi Saju,
    There are 2 types of dropdown ui elemts:
    1. For DropDownByIndex UI element we need to bind the text property to an attribute within a context node, which contains several elements (cardinality = 0..n). The number of elements defines the possible entries in the list. In the WDDOINIT method we can prepare an internal table with the values and bind it to the node and the lead selection defines the selected element.
    For example if u have defined a node 'TEXT' with cardinality '0..n' with attribute TEXT. Bind the text property of DropDownbyIndex UI element to attribute Text of context node Text.
    In the WDDOINIT method you can prepare an internal table with the values and bind it to the node and the lead selection defines the selected element.
    The below code sample may help.
    method WDDOINIT .
    data:
    node_text type ref to if_wd_context_node,
    stru_text type if_componentcontroller=>element_text,
    tab_text type if_componentcontroller=>elements_text .
    node_text = wd_context->get_child_node( name = if_componentcontroller=>wdctx_text ).
    * Set/fill your values
    stru_text-text = 'Value1'.
    append stru_text to tab_text.
    stru_text-text = 'Value2'.
    append stru_text to tab_text.
    * set values to the node
    call method node_ddi_also_text->bind_table
    exporting
    new_items = tab_text.
    endmethod.
    2. For DropDownByKey UI element bind the SelectedKey property to an attribute within a context node. Then you must provide the fixed values (table with key value combination) in a different way and store them in the node info. We can use the elements get_attribute method to get the attribute value which user has selected.
    For this we need to use the interface IF_WD_CONTEXT_NODE which has a method GET_NODE_INFO, which returns meta information on the respective node. This information is of type IF_WD_CONTEXT_NODE_INFO.
    Kindly refer the following code:
    method WDDOINIT .
    data: NODE_INFO type ref to IF_WD_CONTEXT_NODE_INFO,
    NODE type ref to IF_WD_CONTEXT_NODE.
    NODE = WD_CONTEXT->GET_CHILD_NODE( 'NODE1' ).
    NODE_INFO = NODE->GET_NODE_INFO( ).
    * To be able to store the fixed values for the attribute in the node info, two
    *additional variables are necessary:
    data: LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST ,
    L_VALUE type WDR_CONTEXT_ATTR_VALUE.
    *WDR_CONTEXT_ATTR_VALUE is a data type defined in the DDIC. It contains *two components KEY and VALUE, both of type STRING.
    *WDR_CONTEXT_ATTR_VALUE_LIST is a table type stored in the DDIC, whose *rows are of type WDR_CONTEXT_ATTR_VALUE.
    *The two variables created in the source text example are used to accept the value *pairs that will later be passed to the node info.
    L_VALUE-VALUE = 'V1'.
    L_VALUE-TEXT = 'yesterday'.
    INSERT L_VALUE into table LT_VALUESET.
    L_VALUE-VALUE = 'V2'.
    L_VALUE-TEXT = 'today'.
    INSERT L_VALUE into table LT_VALUESET.
    L_VALUE-VALUE = 'V3'.
    L_VALUE-TEXT = 'tomorrow'.
    INSERT L_VALUE into table LT_VALUESET.
    NODE_INFO->SET_ATTRIBUTE_VALUE_SET (
    NAME = 'ATTRIBUTE1'
    VALUE_SET = LT_VALUESET ).
    endmethod.
    Hope this helps.
    Best regards,
    Suresh
    Message was edited by:
            Suresh Honnappanavar

  • How to populate values in a Listbox parameter in selection screens

    I have a parameter(as list box) field in selection screens. And now I want to populate a list from a ztable field values.  How to do that.
    Thanks in Advance

    Hi,
    You have to use the FM VRM_SET_VALUES.
    Check this example..
    TYPE-POOLS: vrm.
    PARAMETERS: p_test TYPE char4 AS LISTBOX VISIBLE LENGTH 10.
    DATA: t_data TYPE vrm_values.
    INITIALIZATION.
    DATA: s_data TYPE vrm_value.
    <b>***Here you to have to do the select and populate the internal table
    ***t_data.</b>
    s_data-key = 'ABCD'.
    s_data-text = 'First four'.
    APPEND s_data TO t_data.
    s_data-key = 'EFGHI'.
    s_data-text = 'Second four'.
    APPEND s_data TO t_data.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    id = 'P_TEST'
    values = t_data
    EXCEPTIONS
    id_illegal_name = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    START-OF-SELECTION.
    WRITE: / p_test.
    Thanks,
    Naren

  • How to populate values to the variables in standard text

    Hi friends,
    I have maintained a standard text in So10 like this invoice number&vbeln&.
    Inside a function module i want to read this text and populate the value to the variable &vbeln&.How to achive this.
    Rgds.

    Thanks Simon but i didn't understand your answer but i will tell you the problem that i want to solve with foreach or iterator
    i have a view that have employeeId and employeeName and ManagerID
    create table employeesView
            EmployeeId           Number,
            EmployeeName      varchar2(100),
            ManagerId             Number
        }i want to make a foreach or Iterator to make
    every Employees with the same manager id to be in the same <af:panelGroupLayout>
    i mean
      <af:foreach or af:Iterator >
           <af:panelGroupLayout >
                   <af:commandButton id="cb1" text="All Employees With Manager Id 1" />
           </af:panelGroupLayout >
           <af:panelGroupLayout >
                   <af:commandButton id="cb1" text="All Employees With Manager Id 2" />
           </af:panelGroupLayout >
           <af:panelGroupLayout >
                   <af:commandButton id="cb1" text="All Employees With Manager Id 3" />
           </af:panelGroupLayout >
      </af:foreach or af:Iterator >How can i do this

  • How to populate value in other field after entering in one field?

    hi everyone.
      when i enter value in one field , automatically some xyz value should be populated  in second field. How would this be possible without any enter? I mean i don want to perform any action like press enter or like that.

    Hello manumb6 ,
    You coud also use "TimedTrigger" UI element for the same and you can specify the "delay" value in seconds.
    Suppose if you enter x value.
    After X seconds it will trigger the particular action associated to UI element.
    My suggestion would be that you generate this UI element Dynamically when you expect end user to enter the value in the input field and system would keep invoking the method and as soon as your objective is met, Delete the UI element .
    Hope this would help.
    Regards
    Anurag Chopra

Maybe you are looking for

  • 2008 MacBook Pro won't boot from Leopard DVD or Target Disk

    Yesterday I was working on my MacBook Pro. I use FontExplorer to manage fonts. I ran the conflicts diagnostic looking for missing font files, which returned about 200 results (I was expecting this). I've moved the fonts installed by Adobe/Microsoft o

  • Help me if you dare! Sorry I have a really complicated issue....

    Hi guys, I have a macbook, white, 2.4 GHz, 2 GB RAM, Snow Leopard (10.6.4) And I have a really complicated issue. I have a Apple iBook Clamshell with no Airport, and a need to connect wirelessly. I figured (since I've done it before with my Xbox 360)

  • IPod 10GB 3rd Generation

    Hey All! My roommate just purchased a 3rd Generation 10GB iPod off eBay and nothing seems to happen. Do you know or have any suggestions for him? If so, great! If not, no worries. I have tried reseting it, using my AC adapter with it, etc. Looking fo

  • Any known issues with processes 'paralyzing' ?

    Hi group since months we are facing a very strange issue. Backgound jobs running suddenly for hours, while colleague workprocesses handle exactly the same workload in minutes. Restarting these 'runaway' workprocesses helps, but is somewhat drastic to

  • Web dynpro - BO

    Dear All, Is it possible to use output of webdynpro web service URL as input to the any of the BO tools(IDT ,UDT)..etc.. Please suggest. Regards, Naveen D