on 05-12-2006 8:25 PM
Hello,
I need to create a Node with attributes dynamically and than assign it to a DROP_DOW_BY_KEY element in ABAP.
I create drop down this way:
drop_down_figure = cl_wd_dropdown_by_key=>new_dropdown_by_key( bind_selected_key = 'REPOSITORY.FIGURES' on_select = 'GET_OPERATOR' ).
cl_wd_grid_data=>new_grid_data( element = drop_down_figure ).
ui_container->add_child( drop_down_figure ).
However, here I bind to REPOSITORY.FIGURES. Instead of doing this I need to bind it to an attribute that I create.
I can access wd_context but I am not sure how to create a node in wd_context, then attribute for that node that will contain items for drop down.
bind_selected_key is type of String. If I create a node with attribute how do I cast it to a String so I can pass it to a constructor of a drop down?
Thank you.
Does anybody has an example how to create a context node with an attribute dynamically?
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Georgy,
Please follow this perefect tutorial for dynamic context,
Thanks,
Raj.
Hi Georgy,
There is a 3 - series weblog for this.
The first one is:
/people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements
The following are the the general steps for creating a node and table where table name is input by the user:
DATA:
UI Elements
group_1 TYPE REF TO cl_wd_uielement_container,
new_tab TYPE REF TO cl_wd_table,
Context Nodes
dyn_node TYPE REF TO if_wd_context_node,
tabname_node TYPE REF TO if_wd_context_node,
Node Info
rootnode_info TYPE REF TO if_wd_context_node_info,
Data Reference (for internal table)
stru_tab TYPE REF TO data,
String (for table name)
tablename TYPE string.
FIELD-SYMBOLS:
<tab> TYPE table.
1) * get node info of context root node
rootnode_info = wd_context->get_node_info( ).
2) * create sub node named TEST1 of structure (tablename)
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = tablename
structure_name = tablename
is_multiple = abap_true ).
3) * get instance of new node
dyn_node = wd_context->get_child_node( name = tablename ).
4) ***** create new UI element table *******************************************************
new_tab = cl_wd_dynamic_tool=>create_table_from_node(
ui_parent = group_1
table_id = 'TESTTAB'
node = dyn_node ).
5) ***** fill context node with data *******************************************************
create internal table of (tabletype)
CREATE DATA stru_tab TYPE TABLE OF (tablename).
ASSIGN stru_tab->* TO <tab>.
Get table content
SELECT * FROM (tablename) INTO CORRESPONDING FIELDS OF TABLE <tab>.
Bind internal table to context node.
dyn_node->bind_table( <tab> ).
Regards,
Srini.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.