cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable(unvisible) attributes of dynamic created node?

Former Member
0 Kudos

Hello experts,

I have a question about how to disable(unvisible) several specific attributes of dynamic created node.

There is a node dynamiclly created from a structure and i want hide some of the attributes in the view.

Here is the code for creating the node.

lv_str_name = wd_comp_controller->tablename.

  context_info = wd_context->get_node_info( ).

  cl_wd_dynamic_tool=>create_nodeinfo_from_struct(

    parent_info = context_info

    node_name   = 'NUMBER_RANGE'

    structure_name = lv_str_name

    is_multiple = abap_true ).

I used remove_attribute method try to do it.

But i received an error said("Can not delete static attributes").

What i don't understand is the node and attributes should be dynamic.

nr_node = wd_context->get_child_node( 'NUMBER_RANGE' ).
  nr_info = nr_node->get_node_info( ).
  CALL METHOD nr_info->remove_attribute
    EXPORTING
      name   = 'ALERT'.

Can somebody please help me.

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kangsuk ,

   Can you use ' if_wd_context_node_info->add_new_child_node'   ...

The method you have used '

cl_wd_dynamic_tool=>create_nodeinfo_from_struct is obsolate. ( Check inside the class).

The method 'nr_info->remove_attribute'  will work fine.

Reply in case you need more info.

Regards,

Monishankar Chatterjee

Former Member
0 Kudos

Hi Monishankar,

Thanks for the answer!

I didn't realize 

cl_wd_dynamic_tool=>create_nodeinfo_from_struct is obsolate.

I will try with  if_wd_context_node_info->add_new_child_node.

Thanks!

Regards,

Kangsuk