cancel
Showing results for 
Search instead for 
Did you mean: 

Delete or remove dynamic Attributes.

Former Member
0 Kudos

Hi experts.

In my WD I have created dynamic attributes with this code:

CALL METHOD context_info->add_attribute
       EXPORTING
         attribute_info = attr_info


Now I need delete the attributes and i'm trying with this method:


CALL METHOD me->remove_attribute
       EXPORTING
              name   = 'NAME_OF_ATTRIBUTE'


It works fine because delete the attributes but it is removing the info of the other nodes. And I don't need this.

How I can delete this attributes without losing the other node data?


Thanks!


         .



         .

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Alberto,

     You need to get the reference of your node and then call the method remove_attribute( )

     Let us say you want to remove the attribute my_attribute from node MY_NODE

Please follow the below code


    data lo_node           type ref to if_wd_context_node.

     data lo_node_info    type ref to if_wd_context_node_info.

   

          " get node ref

          lo_node = wd_context->get_child_node( name = 'MY_NODE' ).

        

          " get node info object

          lo_node_info = lo_node->get_node_info(  ).

    

          lo_node_info->remove_attribute(

               exporting

               NAME = 'MY_ATTRIBUTE' ).

you can also try the method REMOVE_DYNAMIC_ATTRIBUTES(  )

Hope this resolves your issue.

Regards,

Rama

Former Member
0 Kudos

Thank you. Your answer have been very helpful for me.

Answers (0)