Skip to Content
0
Former Member
Oct 02, 2012 at 06:21 PM

Create dynamic context node using dynamic internal table

285 Views

Hi Experts,

I have a requirement where I need to build a dynamic internal table with dynamic columns => structure of the internal table is also dynamic

Now I have to display it using ALV

I have written logic to build dynamic internal table and written logic to set data to ALV

Only part missing is creating dynamic node for this dynamic internal table

I have populated my final internal table i.e dynamic internal table <lt_dyntable> with data

( FIELD-SYMBOLS: <lt_dyntable> TYPE STANDARD TABLE )

I have used following code for creating dynamic node:

DATA rootnode_info TYPE REF TO if_wd_context_node_info.
DATA dyn_node TYPE REF TO if_wd_context_node.
DATA tablename TYPE string.
rootnode_info = wd_context->get_node_info( ).
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = tablename
structure_name = tablename ?????
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( name = tablename ).
dyn_node->bind_table( <lt_dyntable> ). "use dyn_node to set data to ALV

But as the internal table is dynamic, I do not have structure_name for this dynamic internal table.

What should I pass to the structure_name which is mandatory parameter but I have a dynamic structure.

Please suggest.

Thanks!

Regards

Vasu