cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByIndex in a table

Former Member
0 Kudos

Dear All

I have a table with Four Colums.Two columns have Dropdownbox and remaining two columns have textview.

how to set the value in the first dropdown box?

Upon Clicking the first dropdown i have to fill the values in the next dropdown box,how to fill the values in the 2nd dropdown?

is it possible to fill the values with in the maintablenode i.e (with in the one datasource)

Kindly Guide me

its very urgent.

Regards

Dhinakaran J

Edited by: Dhinakaran Jeyachandran on Apr 12, 2008 8:40 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dhinakaran

Let's say you create a context node 'FLIGHT' which has 2 sub nodes 'CARRID' having attribute as carrid and subnode 'CONNID' having attribute connid.

Create two attributes under the root node 'FLIGHT' , named: fldate and price

Set the cardinality 0:n for all three context nodes and singlaton property set.

All attributes are taken from sflight table.

Now create a supply function for context node 'CARRID' and fill it with data.

Create a 'TABLE' UIelement in your view and create binding with the context node 'FLIGHT'. Your table will have only two column buy now : fldate and price.

Under the 'TABLE' UIelement, from the context menu, select 'insert table column'. From the context menu of this newly created column choose "Insert cell varient". Give any name to it and take its type as 'DropDownByIndex'. Map the text property of this 'DropDownByIndex' Uielement with context sub node 'CARRID'.

In same uielement, on onSelect property create a event handler 'GET_CONNID'.

Similaly add one more col to table and map it with other sub node 'CONNID'. Dont associate any action with this column

now read the context node 'CARRID' in event handler method 'GET_CONNID' and based on the value selected by user, fill data in context node 'CONNID' as we do in supply functions.

it will work.

Thanks

Vishal Kapoor

Former Member
0 Kudos

Hai

how to create a supply function for context node 'CARRID' and fill it with data.

guide me how to proceed the above scnario

Regards

Dhinakar

Former Member
0 Kudos

hi dhinakaran......

in your context, go to the properties of the node that is bound to youur drop down or table. there you have a option called supply function. just enter a name in it and double click it. it takes you to the editor. there you can specify the codings for filling your node.

---regards,

alex b justin

Former Member
0 Kudos

Hi Dina,

When creating the node in context you have to create Supply function.

If your node CARRID is already created means select the node and right click ---> change.

One pop up menu will appear and it shows the option for supply function.

Give some name to that supply function and then go to method tab.

In that method tab your sypply function name will appear.

Go inside to the method and using select querry pass the data drom Data base table to your method.

whwn ever the node is fetched the supply function will executed and it passes the values to your node.

Thanks.

Former Member
0 Kudos

Hai

thanks for useful tips.

after binding the dropdownbox in a table, still the table fields are showing noneditmode i.e i will not see the dropdown box in a table.

guide me

Regards

Dhina

Former Member
0 Kudos

hi dhinakaran......

in your supply function... you should fill your node using bind_table. then only it will be available in your table.

---regards,

alex b justin

Former Member
0 Kudos

Hai

my main table node name - POITEM

sub node name - PONODE1

i have written supply function name (Suuply_po) in PONODE1

like the following syntax

data:

node_poitem type ref to if_wd_context_node,

node_ponode1 type ref to if_wd_context_node,

elem_ponode1 type ref to if_wd_context_element,

stru_ponode1 type if_employeepopvu1=>element_ponode1,

itab_sflight_node type STANDARD TABLE OF ZSPOID1,

stru_sflight_node LIKE LINE OF itab_sflight_node.

SELECT poid FROM ydhina_drop1 INTO TABLE itab_sflight_node.

node_ponode1->bind_table(

new_items = itab_sflight_node

set_initial_elements = abap_true ).

Still i will not see the drop down box in a table

Eventhough i have written the above syntax in wddoinit method

i am getting the following error

" Access via 'NULL' object reference not possible."

Guide me

Regards

Dhinakar

Former Member
0 Kudos

hi dhinakaran.....

do not use a subnode.

have a node seperately for the table and bind it.

then create a seperate one for drop down.

now right click the table ui element and add a column.

then insert a dropdown in that column and bind the attribute.

now it will work.

---regards,

alex b justin

Former Member
0 Kudos

Hi Dhina,

In the internal declarations also you need to make some modifications.

itab_sflight_node type STANDARD TABLE OF ZSPOID1,
stru_sflight_node LIKE LINE OF itab_sflight_node.

Instead of the above code use below one.

data : itab type if_employeepopvu1=>elements_ponode1,
          stru_sflight_node LIKE LINE OF itab_sflight_node.

and also using debugging check whether your internal table has data's or not.

Thanks.

Former Member
0 Kudos

Thanks for the tips

i have created the seperate node for drop down

but still the table is nonedit mode

Shall i add some code in wddoinit method?

Shall i create element for dropdown like in dynpro java?

always the tables shows nonedit mode with no dropdownbox

Regards

Dhina

Former Member
0 Kudos

hi dhinakaran....

the table will be in editable mode only if there are any values in the table...

check whether the tables and drop downs are getting filled, through debugging.

---regards,

alex b justin

Former Member
0 Kudos

Yes.i found mistake for calling supply function method.

how to call the supply function when we load the form?

Shall i call that method in wddoinit method?

Because after setting the debugg in supply method it will not come?

Regards

Dhina Kar

Former Member
0 Kudos

hi dhinakaran.......

a supply function will be automatically called when the view is loaded.

or

you can use the <node>->invalidate( ). method to call the supply function explicitly.

---regards,

alex b justin

Former Member
0 Kudos

Hi Dhina,

Supply function is also like DOinit. It calls only one time. So before the screen will displayed in the browser it should go to debugging mode.

Transcation

Code for Invalidate method :

data : node_node1 type if_wd_context_element.

node_node1 = wd_context->get_child_node( name = 'NODE1' ).

 elem_node1 = node_node1->get_element( ).

node_node1->invalidate( ).

Thanks.

Former Member
0 Kudos

Yes.

i set the wddoinit method like the following syntax

data:

node_ponode2 type ref to if_wd_context_node,

elem_ponode2 type ref to if_wd_context_element,

stru_ponode2 type if_employeepopvu1=>element_ponode2 .

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

node_ponode2 = wd_context->get_child_node( name = if_employeepopvu1=>wdctx_ponode2 ).

  • @TODO handle not set lead selection

if ( node_ponode2 is initial ).

endif.

  • get element via lead selection

elem_ponode2 = node_ponode2->get_element( ).

node_ponode2->invalidate( ).

now it goes to the supply function method.

internal tables are having the records now.

but i am getting the error like this

" Access via 'NULL' object reference not possible."

i think this is the last error....

regards

Dhinakar

Former Member
0 Kudos

hi dhinakar.....

jsut debug and check out of where this message arises.

---regards,

alex b justin

Answers (0)