on 01-22-2009 8:33 AM
Hi,
I've create a node called node1 which contains 3 attributes str1, str2, str3. I've created a table in the layout which is binded with the node1. Could any body tell me how to write the code so that i can pass and display my own values in the table.
Regards
Swapna
Hi Swapna,
I think you are new to WD ABAP. Welcome to community as well.... as you can see this is one of the basci issue i am sure you might have got the thread or blog or wiki for the same. now why i am saying this is because you can save your time and you dont have to wait for anybody's reply......
for your question... you have to create an internal table and you have to bind it with your node...
see the code below...
data lo_nd_cn_table type ref to if_wd_context_node." i am creating refrence to my node
data lo_el_cn_table type ref to if_wd_context_element " to element of node
data it_table type wd_this->elements_cn_table. " an internal table of type of your node
data wa_table type wd_this->element_cn_table. " work area for internal table
data it type standard table of t005t.
data wa type t005t.
select * from t005t into table it.
loop at it into wa.
wa_table-ca_one = wa-land1. " ca_one, ca_two are all my attributes name....
wa_table-ca_two = wa-landx.
wa_table-ca_three = wa-natio.
wa_table-ca_enable = abap_true.
append wa_table to it_table.
endloop.
lo_nd_cn_table = wd_context->get_child_node( name =
wd_this->wdctx_cn_table ).
* get element via lead selection
lo_el_cn_table = lo_nd_cn_table->get_element( ).
lo_nd_cn_table->bind_table( it_table ).
data lo_nd_cn_table2 type ref to if_wd_context_node.
" i am binding my internal table with UI
"table node
Please note one thing name of the attribute and name of the columns of internal table which you are binding with node must be same
regards
Pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
u need to fetch the data into intertable and bind.Plz check this.
data:
Node_table type REF TO IF_WD_CONTEXT_NODE,
Itab type standard table of TABLE.
get data from table
select * from TABLE into table Itab.
navigate from <CONTEXT> to <TABLE> via lead selection
Node_table= wd_Context->get_Child_Node( Name = `NODE_name` ).
bind internal table to context node <TABLE>
Node_TABLE->Bind_Table( Itab ).
Edited by: Kalyan Chakravarthi on Jan 22, 2009 9:52 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One more thing i have used select query as an example, using select query in WD ABAP violates the concept of MVC dont use it in your application.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swapna,
Just create an internal table having fields same as your attributes(i.e attr1, attr2, attr3). Get the values in this internal table with the help of select query or any FM. then bind it with your table node. Refer the code:
DATA lo_nd_node TYPE REF TO if_wd_context_node.
lo_nd_node = wd_context->get_child_node( '<NODE NAME>' ).
lo_nd_node->bind_table( <internal table name> ).
I hope it helps.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.