on 04-12-2008 7:23 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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
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.
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.
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.