DropDownByIndex selection

Hello everybody!
There is any simple way to select de DropDownByIndex item based on the RFC result?
I'll explain...
For example: I ve got a Customer sign up, where the client must to choice the Region in a DropDownByIndex object ( provided by a RFC ).
It works fine... My problem is: When I need to update de customer's data, I need to enter in this view and select the Region based on the saved key. I did a function that iterate in de Region elements looking for the saved key, but I think it is not the better solution!
There is any better way to do this? DropDownByKey is not a option!

Hi Ramakrishna Venkat and Victor Shafran!
Tks for your answers!
Ramakrishna Venkat, I did what you said, but it isn't my problem.
I'm saving the Region's key! My problem is how to select the saved value in my DropDownByIndex field!
It didn't uses a KEY like a enumerator ( just like DropDownByKey ). It uses indexes! When I need to select some value, I'm interating the elements looking for the key, and then, I select the value!
It works, but I think that there is another better way!
Tks

Similar Messages

  • How to Select a value from DropDownByIndex -Urgent

    Hi All,
    I have dropdownbyindex UI elements in my Views, I get values from BAPI. When click records in a table, It goes to another view to display full record. Here i have dropdownbyIndexes So it should select one of appropriate value in dropdownbyindex based on record(Value) in table.
    Example:
    <u><i><b>In Table View</b></i></u>
    id                  title                 status          priority
    10000      webDynPro            New              Low
    <i><u><b>Detail View:</b></u></i>
    id                   10000
    title                 webDynPro
    Status             New                  [New,Old,Open,Closed]---DropDownbyIndex
    Priority            Low                   [High,Low,Medium]---DropDownByIndex..4m BAPI
    How to select Appropriate Values from DropdownbyIndex. if any one has sample code, that will be helpful.
    Note: I am using Model Nodes
    Thanks and Regards
    Ravi Golla

    Hi Ravi,
    In details view, you will have corresponding context node created for Status and priority dropdown fields.
    Let suppose, context node for Status is, StatusNode.
    value attribute inside this is,
    StatusNode
      |_ StatusAttrib
    Now, you need to write following code to set l_status ="LOW" value in it.
    wdContext.nodeStatusNode().moveFirst();
    for(int i=0; i<wdContext.nodeStatusNode().size(); i++)
        if(wdcontext.currentStatusNodeElement().getStatusAttrib().equals(l_status)
              wdContext.nodeStatusNode().setLeadselection(i);
              break;
    wdContext.nodeStatusNode().moveNext();
    write same code for priority also.
    Let me know if it is not working with you.
    regards,
    Bhavik

  • How to select a default value in a DropDownByIndex

    Hi,
    I have a dropdownbyindex in a table. I need to make default selection of an item in the dropdown.
    I have prepopulated dropdown from bapi result, "1", "2", "3", "4". I have another bapi result which gives me a selected value "2". I need to default this to the dropdown when my page gets loaded.
    1st bapi result  - (model nodes)
    _input
    _output
    _list
    attribute (1,2,3,4) (list of elements)
    I have a context node created for the table items.
    nodeitems
    str (2) -element to be defaulted.
    I am writing this code:
    int lead = 0;
    for(int i = 0; i < X.size; i++){
    IWDNodeElement elem = wdContext.nodeDataNode().getElementAt(i);
    if(X.equalsIgnoreCase("2"))
    lead = i;
    break;
    wdContext.nodeX.setLeadSelection(lead);
    For size of X, I am taking
    nodeInput.nodeOutput.nodeList.size()
    But this gives me size of thelist 0 whereas it is populating the whole list.
    Hope I have made it clear.
    Please help.
    Thanks

    Cardinality                Selection              Singleton
    _input -      0..n          0..1          true
    _output -      0..1          0..1          true
    _list -      0..n          0..1          true
    nodeItem - 0..n          0..1          true
    Thanks

  • How can I access the selected element of a DropDownByIndex-box?

    Hi,
    I want to create a WebDynpro with two web services. I created the first request with the first web service and the results are displayed in a DropDownByIndex-Box. Now the user should choose one of the results and I would like to use this for the request with my second web service. How can I access the selected Element of a DropDownByIndexBox in the Code?
    Thank you!!
    Julia

    Hi Julia,
    when user select one element in drop down it automatically set lead selection of node binded to dropdown.
    For example if you bind a dropdown to node myNode with value attribute myAttribute the lead selection of node myNode is set in the position of element choose from user.
    So to take this chooised element use this code:
    wdContext.currentMyNodeElement.getmyAttribute()
    bye
    Andrea

  • How to perform multiple selection from dropdown list

    Hi,
           I have developed one application in which i have taken one dropdownbyindex and entered some values in it, now i need to have multiple selection of entries, can any one please suggest how to do these
    Regards,
    Prasanna

    A drop-down list is by definition a 1-from-many selector.
    Armin

  • Change UI configuration dynamically when ever user selects a new value in a drop down field in WebUI

    I enhanced the standard activity component (i.e BT126S_APPT ). In this component, in BT126S_APPT/ApptSQ view there is a field 'PROCESS_TYPE' which is a dropdown. I have created a server event for this dropdown. So that whenever user selects a value in that dropdown, a event is called and after that DO_CONFIG_DETERMINATION is called. In DO_CONFIG_DETERMINATION, I am checking the value of 'PROCESS_TYPE' and based on that i am setting different config keys, by calling SET_CONFIG_KEYS( ). But the configuration is not changing in WebUI. When I press F2 in WebUI its showing the config keys( searched for ) as I set, but the found config keys are same as before. I have created the configuration with the new configuration keys. Please help, I am new to crm.

    Hello Shakthi,
    The easier option would be to convert the DropDownByKey to DropDownByIndex. If you still want to proceed with DropDownByKey then you need to initialise the ALV data again.  do the following
    1. after changing the attribute-value_set, call the ALV interface controller method SET_DATA and pass the instance of the context node.
    2. reintiliase all the ALV settings like edit mode, converting the column editor to DropDownByKey etc....
    This will ensure the new attribute value set is reflected in the ALV component.
    BR, Saravanan

  • Help Required For DropDownByIndex and Table

    Hi All,
       Could anybody help me to solve my problem?
       Actualy I am working with one DropDownByIndex and two
       Tables.Where within one viewset DropDown
       box and one Table(say Table1) are in one view and 
       another one table(say Table2) is in other view.
       DropDown box is  maped with one attribute suppose
       countryName and and Table1 is maped with collageName
       and locationName. So, when I will select the DropDown
       with one countryName then the table1 will show all the
       available collageName and locationName with multiple
       row.
       In other view I mean the Table2 is bind with
       availableCourse and courseDuration this two
       attributes. So whin I will click one row of Table1
       that means one collegeName is selected then the
       Table2 will show the availableCourse and
       courseDuration for that particular college. When I
       will select next row of Table1 then the value of
       Table2 will be different.
       Could anybody help me by sending the code and
       details?
       With Thanks and Regards
       Sudip

    One way is to get lead selected of drop down index , then get lead selected of table1 and pass it via a method to wdDoInit in the 3rd view so that you know what has been clicked in table1 and then accordingly get the data in table2.
    Another way you can do this is to map the tables and drop down index to value nodes and create them in the component controller and then map these value nodes to the respective views. Now when your table2 view is triggered you get the lead selected in the value node of the table1 and accordingly generate the table2.

  • Problem when mapping  model attribute to dropdownbyindex

    HI
    I am mapping model attribute ( this is mapped to Model field of RFC ) to DropDownbyIndex.
    Once i call BAPI the executed list of values populates into dropdown but it doesn't show first value, instead it puts one extra space in dropdown ( 1 blank by default + 1), when we try to select this blank value it gives error.
    Pl help me solving this issue
    Thanks!

    Hi Ravindra,
    It might be write the all code in BAPI side only.
    After writing the bapi code u can retrive thru only DropdownbyIndex.
    What ever u created means Cusomecontroller or component controller in init() method u created BAPI instance and send input to the BAPI.
    When you setting the paramaeters in init() megtod
    U can do like this.
    bapi input = nwe bapi();
    input.setparametername("firstparameter displaying onthedropdownbox");
    for example
    input.setDoc_type("orders");
    add like this.
    Hope this will help
    nageswara.

  • Wait for LeadSelect of DropDownByIndex

    Hello,
    i''ve got a problem with a DropDownByIndex-Field and a LinkToAction-Field inside a complex Web Dynpro Table. Link To Action depends on Selection of DropDownByIndex. If the user selects a value in DropDown-Field an changes to the next column with Tab-Key, execution LinkByAction with Enter-Key, sometimes this action is performed before Lead Selection of Drop Down is updated.
    Hope you understand the problem
    Is there any possibility to wait for the Lead-Select-Event to complete, i.e. to execute the Action of the Link By Action as soon as the lead select event is completed
    Kind regards,
    Johann

    Hi,
    Check "compatibilityMode" of your table properties. By default  it is "auto".  On clicking any action element in table cell, OnLeadSelect is also fired. If you change that default behavior, you will have full control on the order of events.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c092333b-0601-0010-e7af-8c227fb6d052
    /people/bertram.ganz/blog/2005/09/13/new-web-dynpro-sample-available--enhancing-table-performance
    ~kranthi

  • Know about DropDownByIndex

    Hi All,
    Can any one please help us in using the DropDownByIndex control.
    Say for example, i am using the DropDownByIndex for getting the Country list with its corresponding Country Code.
    When i select the Country Name the corresponding Country Code is saved in the bapi.
    Problem is :
    How can i select in the DropDownByIndex control the Country Name by giving its corresponding Country Code which i have saved.
    Regards,
    Ramanath

    Hi,
    I suggest you to use DropDownByKey (DDBK) since you want to display the country name in the drop down but want to get the country code when the user selects a country.
    Considerng your context to be as
    Context
    --Country(node)
    CountryCode(attribute)
    CountryName(attribute)
    Create a DDBK and map the selectedKey property of DDBK to CountryName in your view context.
    Go to your component controller and add a method PopulateCountryNames
      public void PopulateCountryNames( )
        //@@begin PopulateCountryNames()
              IWDAttributeInfo atrInfo = wdContext.nodeCountry().getNodeInfo().getAttribute("CountryName");
              IModifiableSimpleValueSet ValueSet = atrInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
    //          ValueSet.put("Default","Select a country"); if you want to show a default value
              for(int i = 0; i < wdContext.nodeCountry().size();i++)
                   ValueSet.put(wdContext.nodeCountry().getCountryElementAt(i).getCountryCode(), wdContext.nodeCountry().getCountryElementAt(i).getCountryName());
        //@@end
    Add the component controller as required controller to the view.
    After executing your bapi for getting the country name and code
    call the PopulateCountryNames method of the component controller.
    This will fill your DDBK node with country code as key and country name as
    value to be displayed in the DDBK.
    Once the user selects the country name
    you can get the country code as below
    wdContext.currentCountryElement.getCountryName();
    // here dont be confused by getCountryName. This returns you
    country Code since this is the key to selected value. set this value to your bapi as input

  • Wording for not selected in drop down possible?

    Hello,
    when a drop down is not selected (leadSelection=-1) it's left blank (the first row).
    Is it possible to fill in a wording for this first row?
    Regards Horst Timcke

    I guess you are talking about the Web Dynpro UI element "DropDownByIndex". There is currently no way to set the text for the empty selection.
    Armin

  • Drop Down List By Key - Including a blank selection

    Hi all,
    In R/3 ABAP, when we reference a data element(with domain) from the data dictionary into a textfield(as dropdown) in a screen, we will be able access the domain values via the F4. The dropdown in ABAP will always include a blank field for selection.
    But in Java webdynpro, I successful bind a model attribute from the model into the dropdown list but when I click on the dropdown list, it contains the domain value but there's no blank field for selection. The page did initial display blank but after selecting other values, I cannot select back the blank field.
    I'm using the DropDownByKey with selectedKey binded to a value attribute that "type = com.sap..." model attribute. (imported field with domain and fixed emuneration)
    How can I configure/code the dropdown list to include that blank field for selection?
    Your help or advise is much appreciated. Thanks
    Best Regards,
    Jansen

    Jansen,
    I suggest you to use DropdownbyIndex UI element and set the <b>initializeLeadSelection</b> to <i>false</i> and <b>selection cardinality</b> to <i>0:1</i> of the corresponding context node. As a result, it will display a blank line.
    If you want to use Dropdownbykey then add one element with blank value.
    Bala

  • Tell me creation ,deleted and updates of dropdownbyindex

    hi
    my name is praveen
    my question iam designing a form related to webdynpro
    in that iam creating two dropdownbyindex in that
    1.userid2.Material id
    sub: i require code samples and binding
    i have to select the items form those and
    1button:insert
    2button:Retrieve
    3buttton:delete
    4thbutton:update
    i have to click those buttons so that i can display in smae page in same table those upadates.
    please tell me my questin to answer very immediately
    because we are facing about code samples

    Hi Praveen,
    Go to layout of the view Create dropdownbyindexUI element
    Create a node_userid having the attribute user_id and bind that attribute to texts property of the dropdown
    write this code in doinit to populate values to the node
    If all user ids are in an vector userid_vec
    for (int i =  0; i <userid_vec.size; ++i)
        IPrivateApplicationView.Inode_useridElement element = wdContext.createnode_useridElement();
        element.setAtt1(userid_vec.ElementAt(i));
        wdContext.nodenode_userid().addElement(element);
    bind an action to property onSelect. you can access the index of the selected element in the event handler in implementation
    wdContext.nodenode_userid().getLeadSelection();
    Link the onAction property of button to an action
    Create an element of the node to which you should add these values
    IPrivate<view name>.I<node name>Element element = wdContext.create<node name>Element();
    element.set<attribute name>(wdContext.nodenode_userid().getElementAt(wdContext.nodenode_userid().getElementAt(wdContext.nodenode_userid().getLeadSelection()).getAttributeValue(" user_id").toString());));
    wdContext.node<node name>().addElement(element);
    Like this for deleting you can loopthrough the node from which you have to delete and identify the element
    int index = 0;
    for(int i = 0;i<wdContext.node<node name>().size;i++)
    wdContext.node<node name>().get<node name>Elementat(i).getAttributevalue("user_id").equals(<Selected element>)
    index = i;
    Once you get the element you can remove it from table
    wdContext.node<node name>().removeElement(wdContext.node<node name>().get<node name>ElementAt(index)
    For update you once you get the index you can go to the element and modify it
    What do you mean by retreiving the element?
    Hope this helps you
    Regards
    Rohit

  • How to select blank as a first element in DropDownBox

    Hi All,
    I have a problem with dropdown boxes. i want to set blank as first value in my dropdown box. SAP has provided with blank but i am using model node. i read about cardinalities and setLeadSelection. but my problem has not been solved. Can any give some suggetions.
    Thanks and Regards
    Ravi Golla

    Hi ,
    Usually , if you make the selection property of the node as 0..1 or 0..n u can achieve it..
    Since its a model node i doubt it.. ! If its a dropdownkey mapped to a simple type.
    a setXXX("  "); would give you an empty value initially... If dropdownbyindex mapped to a model node.. i guess.. you have to copy it to a value node and work on it,
    Regards
    Bharathwaj

  • DropDownByIndex and structured Node

    Hi,
    I have defined a structure with a field display of type string.
    I create a context node from that structure so that I have a node attribute
    named display of type my_struct-DISPLAY
    Problem is that I would like to display this attribute in a dropdownbyindex but when I want to bind the text, my attribute is grayed so I cannot select it.
    Is this a bug ? How can I display in a dropdownByIndex an attribute coming from a dictionary structure.
    Thanks,
    Thierry

    Hi Koen,
    Sorry but my question is not how to use a dropdownbyIndex. Hadn't the node been typed from a dictionary structure, I would not have had any problem.
    Question is why I cannot bind the text field from a node built from a dictionary structure ?
    I have used this mechanism in Java and it was working fine.

Maybe you are looking for

  • Home wireless network keeps "timing out." Help!

    I currently have an eMac with a wired connection to an AirPort Extreme base station that creates a wireless network in my home with Time Warner Road Runner. I also have an Airport Express that acts as a relay station. For some reason lately, the wire

  • How do I recover an old Apple ID password if I had deleted that email account (Apple ID Username)?

    Somehow my wife's MacBook had a guest account with my old Apple ID.  I no longer know the password for it (since I had gotten my iPhone, I had created a new Apple ID). I can't recover the password because I erased that email account and created a new

  • Video playback on XP pro

    I was recently using my netflix online account and to use it i have to switch to xp . The problem i am having is that it appears that my graphics card isnt processing the data correctly. It displays all green and un viewable., The audio is fine, but

  • World minutes not appearing in linked account?prof...

    Hi - my office 365 is linked successfully to my skype account, but world minutes, while showing in my office account, do not show in my skype account. My skype account says I do not have any subscriptions, and does not give me the options of my world

  • Client use of pc version contribute when developed on mac

    Question: I am in the process of developing a website in Dreamweaver on my Mac. My client wants to be able to tweak the website once it is done with Contribute, however they will be using a PC. Are there any known issues that I should be aware of bef