Skip to Content

Dropdown by index

Hi ,

I want to display the check table entries used in a

Domain field in a dropdown box.

for this i created a dropdown box using ui element dropdown by index.

how can display entries in the dropdown.

please specify the context details also for this.

if possible give me the code.

please help me out.

points are sure.

thanks,

sushant

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2007 at 09:06 AM

    u the following code with drop down by key

    field-symbols: <EXT_F> type tablename.

    data: node_info type ref to if_wd_context_node_info.

    data: value type wdy_key_value,

    value_set type wdy_key_value_table.

    node_info = wd_context->get_node_info( ).

    node_info = node_info->get_child_node( `NODENAME` ).

    call method cl_wd_dynamic_tool=>get_table_data

    exporting

    tab_name = 'table name'

    row_count = 0

    importing

    data = internal table .

    loop at internal table assigning <EXT_F> .

    value-key = <EXT_F>-element name.

    value-value = <EXT_F>-element name.

    insert value into table value_set.

    endloop.

    node_info->set_attribute_value_set( name = `ATTRIBUTE NAME` value_set = value_set ).

    clear : value, value_set.

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Suhail,

      For the code which u gave for 'dropdown by index' , I have a querry.

      " If we use this logic , the value is not getting defaulted in the dropdown .how to default the values in the dropdown . "

      The code which u gave was:

      u the following code with drop down by key

      field-symbols: <EXT_F> type tablename.

      data: node_info type ref to if_wd_context_node_info.

      data: value type wdy_key_value,

      value_set type wdy_key_value_table.

      node_info = wd_context->get_node_info( ).

      node_info = node_info->get_child_node( `NODENAME` ).

      call method cl_wd_dynamic_tool=>get_table_data

      exporting

      tab_name = 'table name'

      row_count = 0

      importing

      data = internal table .

      loop at internal table assigning <EXT_F> .

      value-key = <EXT_F>-element name.

      value-value = <EXT_F>-element name.

      insert value into table value_set.

      endloop.

      node_info->set_attribute_value_set( name = `ATTRIBUTE NAME` value_set = value_set ).

      clear : value, value_set.

      Please let us know early so that it will be most helpful for us.

      Thanks,

      Hema.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2007 at 09:16 AM

    Hi Sushant

    To display check table entries, u simply take UIElement "InputField" instead of drop down by key or by index.

    Create a context node and add one attribute to it of the type of field which you want to display on screen.

    Go in to the check table which you want to use to display the possible entries.

    See if any of the search help attached to the field you want to use.

    if yes then copy the name of the search help

    Go back to the context attribute which you created

    Under property section of that context attribute, set

    "

    input help mode" field as automatic, in field "determinded input help" enter the search help name copied from check table.

    activate your WD component and test it.

    If search help is not in the check table, then simply create a search help and in the selection method of that search help, enter the name of your check table.

    Thanks

    Vishal Kapoor

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2007 at 08:48 AM

    Hello Sushant,

    The better way to achieve this is to have a DropDownByKey. The selectedKey property of the drop down should be bound to an attribute in the context. You also need to create a value set and attach it to the node info. This can be done by creating a list of values of type WDY_KEY_VALUE_TABLE from the check table and then calling the method SET_ATTRIBUTE_VALUE_SET on the node info.

    Hope this helps.

    Regards,

    Neha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2007 at 09:12 AM

    You can look into the component WDR_TEST_EVENTS that has views for dropdown by index and key. Refer to this First Demo Example Error where I had given sample code. You can do this by index or key.

    Regards

    nithya

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.