cancel
Showing results for 
Search instead for 
Did you mean: 

filling drop down list

Former Member
0 Kudos

hi,

i have two questions:

1. i have a drop down list as one of the columns in my table. i have context node having an attribute. how do i fill this drop down list.

2. once this drop down list is filled, i want to pass the value to a method when i select a value from the drop down list.

waiting for reply.

Thanks & Regards,

Ritwik.

Accepted Solutions (1)

Accepted Solutions (1)

former_member515618
Active Participant
0 Kudos

Hi Ritwik,

Use method set_attribute_value_set of is used to set dropdown values to an attribute of a node.

DATA: lx_current_controller TYPE REF TO if_wd_controller,

lx_node_info TYPE REF TO if_wd_context_node_info,

lx_element TYPE REF TO if_wd_context_element,

ls_value TYPE wdy_key_value,

lt_value_set TYPE wdy_key_value_table,

lx_current_controller = wd_this->wd_get_api( ).

Get the Values to that need to be set as dropdown,

  • Build the values set internal table. by doing the below.

CLEAR ls_value.

ls_value-key = ls_t005t-ID.

ls_value-value = ls_t005t-Airine.

APPEND ls_value TO lt_value_set[].

  • Set the dropdown.

  • Get Context reference

lx_node_info = wd_context->get_node_info( ).

  • Get Node 'INPUT_NODE' Reference

lx_node_info = lx_node_node->get_child_node( name = 'INPUT_NODE' ).

  • Set the Drop down.

lx_node_info->set_attribute_value_set( name = 'CARRID' value_set = lt_value_set ).

This would build the dropdown for the attribute.

Bind this to the column that must be displayed as DD.

Set the column type as 'Drop Down'

Hope this helps.

Regards,

Sravan Varagani

Edited by: Sravan Varagani on Mar 31, 2008 2:32 PM

Former Member
0 Kudos

hi alex,

i wrote the following code:

DATA lo_nd_test TYPE REF TO if_wd_context_node.

DATA lo_el_test TYPE REF TO if_wd_context_element.

DATA ls_test TYPE wd_this->element_test.

DATA lt TYPE TABLE OF spfli.

  • navigate from <CONTEXT> to <TEST> via lead selection

lo_nd_test = wd_context->get_child_node( name = wd_this->wdctx_test ).

  • get element via lead selection

lo_el_test = lo_nd_test->get_element( ).

SELECT * FROM spfli into CORRESPONDING FIELDS OF TABLE lt.

CALL METHOD LO_ND_TEST->BIND_TABLE

EXPORTING

NEW_ITEMS = lt

  • SET_INITIAL_ELEMENTS = ABAP_TRUE

  • INDEX =

.

it gave me the error ASSERT CONDITION VIOLATED.

regards,

Ritwik.

Former Member
0 Kudos

Hi,

Try to change the below line of code.

DATA lt like TABLE OF ls_test.

Thanks.

Former Member
0 Kudos

hi ritwik....

you got this error because you are havinga node inside another. you can follow my above suggestion. use drop down by index.

--regards,

alex b justin

Former Member
0 Kudos

hi alex,

just need to confirm one thing.

so i have to create two separate nodes. one for the entire table and one for only the drop down list.

and do i have to populate both the nodes. and which one will i bind to the drop down then.

thanks & regards,

Ritwik.

Former Member
0 Kudos

hi ritwik......

node1 will be having the values for table.

node2 will be having the values for drop down.

node1 must be bound to the table.

create an extra column in the table uielementas dropdown and bind node2 to it.

---regards,

alex b justin

Former Member
0 Kudos

hi alex,

i created two nodes:

TEST for the table and

DD for the drop down list.

i binded the drop down with DD.

and i wrote the following code in my WDDOINIT.

nthing is getting displayed in the Drop Down List.

DATA lo_nd_dd TYPE REF TO if_wd_context_node.

DATA lo_el_dd TYPE REF TO if_wd_context_element.

DATA ls_dd TYPE wd_this->element_dd.

DATA lt TYPE TABLE OF spfli.

  • navigate from <CONTEXT> to <DD> via lead selection

lo_nd_dd = wd_context->get_child_node( name = wd_this->wdctx_dd ).

  • get element via lead selection

lo_el_dd = lo_nd_dd->get_element( ).

SELECT carrid from spfli into CORRESPONDING FIELDS OF TABLE lt.

CALL METHOD LO_ND_DD->BIND_TABLE

EXPORTING

NEW_ITEMS = lt

  • SET_INITIAL_ELEMENTS = ABAP_TRUE

  • INDEX =

.

regards,

Ritwik.

Former Member
0 Kudos

hi ritwik.....

it would be better if you go for a supply function..

now have a break oint in the select query and check whether the values are getting filled in the table.

---regards,

alex b justin

Former Member
0 Kudos

hi alex,

thanks a lot. its working now.

regards,

Ritwik.

Former Member
0 Kudos

Could you please help me to add values to the drop down list in a table

Former Member
0 Kudos

hi mohhamad,

create two nodes. bind one with the table and bind the attribute of the other node with ur drop down.

both the nodes should have cardianality 0:n.

and bind values to both the nodes.

it will work.

regards,

ritwik.

Former Member
0 Kudos

How to select the default values in the drop down list

Former Member
0 Kudos

Hi,

could you be a bit more specific.

regards,

ritwik.

Former Member
0 Kudos

Hi RitwiK

For example I have 3 values Good, Average, Poor. I need the Average to be displayed as the text of dropdown not when we click the down arrow, when it is clicked it should show , all three as in our ordinary case

Answers (1)

Answers (1)

Former Member
0 Kudos

hi ritwik......

a node of cardinlity 0..n must be assigned to the drop down. fill the drop down with values just as you would do for a table.

drop down as an action called on select. make use of that.

--regards,

alex b justin

Former Member
0 Kudos

hi,

it is giving the error assert condition violated

Former Member
0 Kudos

hi ritwik...

in which part do you get this error.....

you have to fill the drop down in wddoinit.

---regards,

alex b justin

Former Member
0 Kudos

hi!,

ya..

my node struc is like this:

input_node(root)

carrid.

connid.

cardianility: 0:n.

table: spfli.

i have a table in which there are two columns and one of the column is a Drop Down box.

now i want to fill the drop down box with all carrid's.

Former Member
0 Kudos

hi ritwik....

this is how you should create:

node for table:

col1

col2

cardinality 0..n.

bind this node to the table.

node for drop down:

col1

cardinality 0..n.

right click table uielement.

insert table column.

rightclick table column.

insert cell editor.

make it as drop down.

bind the drop down node to it.

write seperate codings for both the nodes.

---regards,

alex b justin