Populate elements in DDK

Hi All,
I have a scenario where I'm using 3 Drop down by Keys in a webdynpro Application.
I have created a structure called country and binded  it to the context for the 1st DDK.
Depending on the selection of country the next two DDK elements should get populated.
for example if the country is selected as India, the next DDK should represent the states like Andhra pradesh, karnataka..etc and the 3rd DDK should contain cities of their respective states.
I have created the other two structures for state and cities.
Could any one help me and advise me how to proceed on this.
regards
ambicasony

try this.
public void fillMaster( )
    //@@begin fillMaster()
    String data[][] = { {"India", "Kerala", "Trivandrum"},
                             {"India", "Kerala", "Kochin"},
                             {"India", "Maharashtra", "Mumbai"},
                             {"India", "Maharashtra", "Pune"},
                             {"USA", "New York", "Albany"},
                             {"USA", "Georgia", "Atlanta"},
                             {"USA", "Arizona", "Phoenix"},
                             {"USA", "Florida", "Tallahassee"},
                             {"USA", "Texas", "Austin"}};
    IPublicExp_1.IMasterElement master;                         
    for( int i = 0; i < data.length; i++){
         master = wdContext.createMasterElement();     
              master.setCountry( data[ i][ 0]);
              master.setState( data[ i][ 1]);
               master.setRegion( data[ i][ 2]);
          wdContext.nodeMaster().addElement( master);     
    //@@end
Adding Country/ States/ Region
private void addCountry(){
            String country = "";
            IWDAttributeInfo cntinfo = wdContext
                                                    .nodeChild()
                                                    .getNodeInfo()
                                                    .getAttribute( "Country");
            ISimpleTypeModifiable sim = cntinfo.getModifiableSimpleType();
            IModifiableSimpleValueSet valset = sim
                                                         .getSVServices()
                                                         .getModifiableSimpleValueSet();
            valset.clear();                                             
            IPublicExp_1.IMasterNode masternode = wdContext.nodeMaster();                                             
            for( int i = 0; i < masternode.size(); i++){
                 country = masternode
                                     .getMasterElementAt( i)
                                     .getCountry();
                 valset.put( country, country);                                                                                      
       private void addState(){
          String state = "";
          IWDAttributeInfo cntinfo = wdContext
                                                  .nodeChild()
                                                  .getNodeInfo()
                                                  .getAttribute( "State");
          ISimpleTypeModifiable sim = cntinfo.getModifiableSimpleType();
          IModifiableSimpleValueSet valset = sim
                                                       .getSVServices()
                                                       .getModifiableSimpleValueSet();
          valset.clear();                                             
          IPublicExp_1.IMasterNode masternode = wdContext.nodeMaster();
          IPublicExp_1.IMasterElement masterele;                                             
          for( int i = 0; i < masternode.size(); i++){
               masterele = masternode
                                   .getMasterElementAt( i);
               if( masterele.getCountry().equalsIgnoreCase( wdContext.currentChildElement().getCountry()))
                    state = masterele.getState();                    
                    valset.put( state, state);                                                                                      
Call method on action of drop downs
public void fillCountry( )
    //@@begin fillCountry()
         addCountry();
    //@@end
  //@@begin javadoc:fillState()
  /** Declared method. */
  //@@end
  public void fillState( )
    //@@begin fillState()
     addState();
    //@@end
vinod v

Similar Messages

  • Populate elements in a drop based on selection made in another drop down

    i need to populate elements in a drop based on selection made in another drop down list. have created list models for populating data from R3. I am using PDK for java development.

    hi,
    to populate the second dropdown from the selection of the first u need to the submit the form on the selection of data from dropdown and based on the selection populate the second dropdown.
    If using jspDynpage u can submit the form on the  ''onChange" event of first drop down.
    If you can let us know what type of application is this i think we can help you in more better way.
    Thanks
    Ritushree Saha

  • Can i report one message and highlight two or more  input field  ?   in WD

    Hi All,
    I can use " report_attribute_error_message " , this will highlight the field with a red border.
    but  can i  highlight the two fields with a red border at the sametime ? 
    Can anyone help me ?
    Thanks!
    Edited by: DDT CHOU on May 6, 2010 10:20 AM

    Hi,
    Yes - but only for a single element
    use method REPORT_ELEMENT_T100_MESSAGE, or REPORT_ELEMENT_ERROR_MESSAGE or REPORT_ELEMENT_EXCEPTION of the message handler..
    data: lo_component type ref to if_wd_component,
          ls_msg type SYMSG,
           lo_message_manager    type ref to if_wd_message_manager.
      lo_component = wd_comp_controller->wd_get_api( ).
      lo_message_manager = lo_component->get_message_manager( ).
    * some code to populate element reference and populate table of attributes...
       lo_message_manager->report_element_t100_message(
                                                 msg                       = ls_msg
                                                 element                   = lo_element
                                                 attributes                = lt_attribs )
    you can pass a table of the attributes you want to relate to the error - but only one element.
    Nor can you highlight a dropdown by index with an error message. (At least not in a table).
    unfortuantely I don't see a way to do the same thing in the FPM message manger. Fingers crossed for NW7.02...
    Hope this helpful,
    Chris

  • Is it mandatory to create Supply function for ItemLIstBox UI

    Hi,
    I am trying to user ItemListbox UI. I followed below link and created it. If am not using supply function ItemLIstbox is not populating data.
    I would like to know if it is mandatory to use Supply function for this UI.
    If not please give me steps to create and populate elements into ItemListBox
    Regards
    Satish
    Edited by: satish jarabana on Jan 23, 2012 11:39 AM

    Thanks Srinivas,
    I hae already done that and am able to see data.
    But my doubt is if we assign data type as Data Element for an attribute, and bind this to an input element or drodown, it will show values by default.
    Is this not the same for ItemListBox.
    Regards
    Satish

  • 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 WBS element and Project definition in Additional Tab

    Hi,
    I have a 2 requirements
    1) we need to populate WBS element and Project definition of an order in PM
    IW 32 trasnaction (Additional data tab).
    2)Also i need to program settlement rules in CJ02 for WBS elements .
    How do i approach ?  when i do manually it is taking the values in IW 32 when the status is released.
    So i think first we need to chnage the Status from Created to released and then start working on step 1 and Step 2
    Kindly suggest.
    Thanks,
    Pradeep.

    Problem one solved ......
    Basically we need to put the status of WBS elememnts and then write a BDC for additional data tab.
    Looking into issue 2......

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

  • Crystal Reports XI Web Elements - populate WESelect element values from database field

    <p>Hi,</p><p>I am using Web Elements with Crystal Reports XI. I need to know how to populate the ElementValues and ElementDisplays arguments of the WESelect function from a database field. </p><p>In the function expert when I click on the ElementsValues and ElementDisplays values a drop down appears which will let me select a field or formula. However, when I try saving and leaving the formula workshop an error message is generated.</p><p> "A subscript must be between 1 and the size of the array".</p><p>I assume this is because the WESelect function is looking for the "|" separator in the ElementValues and ElementDisplays arguments.</p><p>Please advise.</p><p>Thanks</p>

    hello,Â
    in the webelements.zip download you should find a DCP report which shows the method for "rolling up" data using a subreport and passing these to a select control using shared variables.
    basically a string running total rolls up the values at run time and character separates them for use by the controls. for any type of select (drop down menu etc.) controls all of the values have to be made available before the main report is run so that's why you use this techique. you can think of it this way...instead of having an asp page that runs a database query and then populates a javascript array for the control, the subreport rolls up the values and passes them to the control.
    other types of controls that you wish to place directly on a group header or details section can be run off of main report fields or formulae...e.g. you can place a checkbox control on the details section without having to roll up the data in advance.
    by just putting a field name in the parameter for a select control, you will only get one value per control.
    i hope that this makes sense as it takes a bit to get used to at first,
    jamie

  • Populate WBS Elements from GR/IR to FI document

    Would like to know how to populate WBS element from Material Document - MIGO (PO document with account assignment = 'P') to FI document?
    Message was edited by:
            Peck Har Poh
    Message was edited by:
            Peck Har Poh
    Edited by: Peck Har Poh on Nov 19, 2009 6:28 AM

    hi
    if ur problem is to find the document number only, then go to tcode me23n and give ur PO number and click on PO history tab on item details.
    hope it works.award if useful.

  • Can we populate UI Element Dropdownbykey at run time

    Hi All,
    Can we populate UI Element dropdownbykey at run time, I am able to populate R/3 data in inputfield type UI element, but how to populate it in dropdownbykey UI element, is it possible??
    Thanks in advance

    Hi Amit,
    Yes we can populate dropdownbykey UI element at run time using data from the R/3. For doing this, try to understand the below given code:
    empCode - Which you bind to the DropDownByKey.
    IContextElement contextElement = wdContext.currentContextElement();
    IWDNodeInfo nodeInfo = wdContext.getNodeInfo();
    IWDAttributeInfo dateAttributeInfo = nodeInfo.getAttribute(contextElement.empCode);
    IModifiableSimpleValueSet dropValueSet = dateAttributeInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
    String empCodeTxt=null;
    //Gives the Size of the List, which is coming from Model
    int nodeLength = wdContext.node<BAPIList>().size();
    for (int i = 0; i < nodeLength; i++) {
    // Gives the Value, which you want to show in Drop Down List Box..
    empCodeTxt=String.valueOf(((IPrivate<viewname>.I<BAPIList>Element)(wdContext.node<BAPIList>().getElementAt(i))).get<Parameter>());
    dropValueSet.put(empCodeTxt, empCodeTxt);
    This piece of code has been taken from the following thread:
    https://forums.sdn.sap.com/thread.jspa?threadID=215743&tstart=0
    Bye
    Ankur

  • How do I populate a "Person or group" field via Elements.xml?

    So I have created a field titled "EmployeeName" and it's a "Person and Group" type. (View the Schema.xml below)
    <Field Name="EmployeeName" ID="{8579a35a-71a8-4070-b907-b6ede0daa352}" DisplayName="Employee Name" Type="User" />
    Now, I'm trying to populate the column via the Elements.xml file. As you can see by the commented out code below, I've tried every combination and I'm still unable to populate this column:
    <ListInstance Title="Employee_Rec_list" OnQuickLaunch="TRUE" TemplateType="10000" Url="Lists/Employee_Rec_list" Description="My List Instance">
    <Data>
    <Rows>
    <Row>
    <!-- <Field Name="EmployeeName">i:0#.f|membership|[email protected]</Field>
    <Field Name="EmployeeName">i:0#.f|membership|[email protected]</Field>
    <Field Name="EmployeeName">0#.f|membership|[email protected]</Field>
    <Field Name="EmployeeName">#.f|membership|[email protected]</Field>
    <Field Name="EmployeeName">[email protected]</Field> -->
    <Field Name="EmployeeName">[email protected]</Field>
    <Field Name="Achievements">Rock Star</Field>
    <Field Name="Achieve_x005f_Des">Cras congue varius metus, in tincidunt metus Vestibulum vel turpis nec leo porttitor pulvinar fringilla ut lacus. a dictum aliquam. Pellentesque non felis cursus, lobortis, mattis arcu. Duis molestie nisi quis lectus tincidunt, a porttitor turpis iaculis. Donec condimentum, tellus sit amet hendrerit aliquet, est eros faucibus nulla, eu ultricies ligula ante id quam. Suspendisse suscipit orci sit amet vestibulum ultrices. Nunc dictum tortor non magna volutpat</Field>
    </Row>
    </Rows>
    </Data>
    </ListInstance>

    Ok I figured it out. You need to you use the users ID.
    <Field Name="EmployeeName">15</Field>

  • Idoc_input_orders populate WBS data element in each line item

    hi experts,
    an idoc is passed thru the standard FM(idoc_input_orders) to create SO. Based on E1EDP19, I am populating WBS data in the WBS element in Account Assignment tab for each line item in the SO. I've EXIT_SAPLVEDA_002 UE, but called for so many time.  Is there a way to be called only once for each line of the sales order.
    Your contribution is greatly appreciate.
    Regards,

    Hi
    Go to WE19,
    Take the IDOC, and change the item index between items.
    For example for item 10 index should be 1.
    For item 20 index should be 2.
    This is happening because there are many items in the idoc and no difference for the child segments to identify their own childs.
    Warm Regards,
    Baburaj

  • How to populate the sales order as a cost object in cost element posting

    When posting sales to a cost element the error comes up stating Account ******** requires an assignment to a CO object.
    This comes from the sales (repair) order and I would like to pass the sales order and line as a cost object.
    Could someone please tell me where I would make the configuration to pass that into the accounting document?
    Thank you,
    Sergiy

    Snavaneetha,
    unfortunatelly I don't have access to any CO consultants that could help me on this one. We are a small company so I am an unofficial CO consultant for time being
    Anyway, maybe I should post this one on the CO forum as well.
    I looked at the material master and I don't see the field for the GL account or cost element anywhere like you said. I do see the account assignment group and that's where my account determination procedure determines the right one to use, and it is trying to post to the account I need it to post but I get the above error, for some reason the sales order that I am billing for does not get passed at a cost object to this cost element account during billing.
    Sergiy
    Edited by: Sergiy Mysyk on Jul 26, 2010 3:25 PM

  • Client Proxy - Response Message does not populate table type element

    Hi,
    I came cross the situation:
    Sync Client ABAP Proxy --->PI -
    > Web Service Provider
    In our response structure, there are some single value (0:1) and table value (0:unbound).
    While testing proxy, we can see response message has one value for table type element, however, input structure table is not populated with the value.
    Any advice or idea ?
    Thanks
    Liang

    Thanks for your advice.
    The proxy is in green status. Anyway, I regenerate it and activate it again.
    The problem still exist.
    For all single elment value, I do not have problem, it seems the proxy treat the table element as single element.
    Regards
    Liang

  • How to populate values in to drop down by index

    Hi in my application  i have dropdownby index with label State.In that dropdown i need to populate all the states of our country like..Tamilnadu,andhraprdesh,Gujrath,Maharastra,Delhi....,and by default it should be populated with Select State ,can u please tell me the code..
    Thanks
    Kishore

    hi,
    1.in ur context create a context value node----eg: MyStates
    2.under that value node create a value attribute--eg: values.
    3.set the cardinality of "MyStates" value node to 0:n
    4.texts property of ur dropdown by index ui element shld be bound to the value attr (values).
    5.in the wdDoInit() method of ur view that has this dropdownbyindex ui element use the follwoing code,
    String    [  ]    states_array    =        new String [  ]   {"tn", "mp", "ap", "karnataka"};
    List list_for_node_elem = new ArrayList();
       for (int i =  0; i <states_array.length; ++i)
          IPrivateMyView.IMyStatesElement elem = wdContext.createMyStatesElement();
          MyStatesElement.setValues(states_array   [i ]   );
          list_for_node_elem.add(MyStatesElement);
       wdContext.nodeMyStates().bind(list_fornode_elem);
       wdContext.nodeMyStates().setLeadSelection(1);
    Regards
    Jayapriya

Maybe you are looking for

  • Upgrading 10.5.8 server to 10.6

    When I tried to begin the upgrade I get an error when picking the drive that says "server cannot startup from this drive". obviously the drive is 10.5.8 server fine. I have other drives but I can't use them. Any ideas. I just want to upgrade a home m

  • Select clause with where part is needs 600 times longer to complete

    Hello. I have two select clauses one with where, which needs 120 seconds to complete and one without where, which completes in 0,3 seconds. I want to know why is that. 120 seconds SELECT B.* FROM (SELECT A.OLOG, MCL_ISPROTOCOLALLOWED('LMOD', 'MCLI',

  • DB Link Hanging in Oracle 10.2.0.3

    Hi, DB link hanging when we are trying to connect remote system in 10.2.0.3 Linux 64 bit. Linux 64 bit ----> Remote Linux 64 bit is not working Linux 64 bit ----> Remote Windows 64 bit is not working Remote Linux 64 bit ----> Linux 64 bit is not work

  • SPCalendarView in custom Webpart

    Hi! I created a custom webpart where I use dropdown list and set SPCalendarView datasource with custom filter from the selected DropDown value. The filter is works good. My problem is, how can I set the "Add new Event" to this SPCalendarView? Please

  • Step by step scree shot of alv

    hi experts, I'm new to abap.Can anyone send me the step by step screen shot material of alv to my mail id:[email protected] that i can understand because im a fresher and i cant understand detailed explanations.Please