cancel
Showing results for 
Search instead for 
Did you mean: 

Assign node to a table at run time

Former Member
0 Kudos

Hi,

In my requirement, I am creating a table at run time in WDDOMODIFY view. I am binding my node nod_ops to this table (export parameter BIND_DATA_SOURCE = 'NOD_OPS' ), which has about 100 rows of data.

Problem is when I run the appication it shows the table but it does not show any data. In the center of the table control it has a message "Table Does not contain visible columns'. How can I make table control show my data from node?

Pl help.

Thanks,

Hardik

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

Debug your application and check whether the table which you are binding to the node has any data or not.

If your internal table has data, check whether names of context node' attributes binded to table and internal table's fields has same names.

Former Member
0 Kudos

Yes internal table has data.

Former Member
0 Kudos

Hi,

Have you set the default values to the properties of the TABLE UI expects. When you create a table UI element statically,

there are some default values set for some properties. How about them.

Former Member
0 Kudos

Here is what I have done,

I have three nodes A, B and C. Node A,B and C are bound with respective itab and have data.

If condition 1.

l_table = cl_wd_table=>( bind_data_source = 'A' ).

elseif condition 2.

l_table = cl_wd_table=>( bind_data_source = 'B' ).

elseif condition 3.

l_table = cl_wd_table=>( bind_data_source = 'C' ).

endif.

I think I am missing somethig here, but not able to figure out what?

Thanks

Hardik

Former Member
0 Kudos

Are you passing data to these nodes ?


"Bind your internal tables to these nodes aas follows;

data: node_a  type ref to if_wd_context_node.
node_a = wd_context->get_chils_node( 'A' ).
node_a->bind_table( itab_a ).
Radhika.

Former Member
0 Kudos

Yes thats true.. my nodes have data..

Former Member
0 Kudos

When we create table at design time, Once we bind table's data_source property to a node, we create binding ( Bind each attribute of a node to table ).

I think this step is missing here.. I am not able to find suitable method for this. Any idea?

Hardik

Former Member
0 Kudos

Can you paste your code for creating a table ?

Former Member
0 Kudos

Here it is..

I have three nodes A, B and C. Node A,B and C are bound with respective itab and have data.

If condition 1.

l_table = cl_wd_table=>( bind_data_source = 'A' ).

elseif condition 2.

l_table = cl_wd_table=>( bind_data_source = 'B' ).

elseif condition 3.

l_table = cl_wd_table=>( bind_data_source = 'C' ).

endif.

This creates an empty table. No node data are populated, though node is populated with data.

Thanks

Hardik

Former Member
0 Kudos

Have you used similar kind of coding ?

" create table
  wd_table = cl_wd_table=>new_table( view        = m_view
                                     footer_visible = abap_false
                                     visible_row_count = -1
                                     selection_mode = CL_WD_TABLE=>E_SELECTION_MODE-NONE
                                     read_only = abap_true
                                     bind_data_source = node_name
                                     design = CL_WD_TABLE=>E_DESIGN-TRANSPARENT ).
  cl_wd_matrix_head_data=>new_matrix_head_data( element = wd_table ).
  wd_container->add_child( wd_table ).
" create column
  wd_table_column = cl_wd_table_column=>new_table_column( view = m_view ).
  wd_table->add_column( wd_table_column ).
" create cell editor
  concatenate node_name '.NAME' into binding_path.  " this is your attribute that you want to bind to the column
  wd_text_view = cl_wd_text_view=>new_text_view( view = m_view
                                                 bind_text = binding_path ). "binding
  wd_table_column->set_table_cell_editor( wd_text_view ).
Radhika

Former Member
0 Kudos

Thanks Radhika..

" create column

wd_table_column = cl_wd_table_column=>new_table_column( view = m_view ).

wd_table->add_column( wd_table_column ).

is missing in my code.. Hopefully this will fix my problem.

Thanks again

Former Member
0 Kudos

Did adding the above lines of code solve your problem ? Radhika