on 10-15-2013 7:56 AM
Hello,
I’m trying to implement a WD table dynamically depending on the contents of an internal table.
In my method I have the following steps :
-> I create my object table :
CALL METHOD cl_wd_table=>new_table
EXPORTING
bind_data_source = 'TAB'
id = 'CPT_TAB'
view = wd_this->gd_view
RECEIVING
control = lo_table
.
-> I set the layout data
lo_table->set_layout_data( lo_layout_data ).
-> I add columns and colum groups depending on the contents of my internal table using add_column & add_grouped_column
-> In same time I build the structdescr object using object cl_abap_structdescr=>component_table.
-> I create and assign structdescr and tabledescr to field symbol.
-> I loop in my internal table in order to fill data in field symbol table <tab>
-> I add a new child node using :
lo_node_info = wd_context->get_node_info( ).
CALL METHOD lo_node_info->add_new_child_node
EXPORTING
name = 'TAB'
static_element_rtti = lo_structdescr
is_multiple_selection = abap_false
is_initialize_lead_selection = abap_false
is_static = abap_false
RECEIVING
child_node_info = lo_node_info.
-> I bind my table
lo_dyn_node = wd_context->get_child_node( name = 'TAB' ).
lo_dyn_node->bind_table( <tab> ).
-> I add the new child
lo_root ?= wd_this->gd_view->get_element( 'TC_TAB' ).
CALL METHOD lo_root->add_child
EXPORTING
the_child = lo_table
My table is displayed with the correct column groups but it is empty !!
Can you see what I’m missing ?
Thanks
David
Resolved by changing sequence:
- Create dynamic structure
- Create node
- Append data to
node
- Create table using node
- Bind table
- Loop at table in order to create column groups.
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
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.