cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear all the attributes under a context node?

Former Member
0 Kudos

Hi all,

I have a context node and there are some attribute under this node.

How to clear all the attribute under this node?

Do I need to set all the value to space for all the attributes ?

Or we have a 'clear method' that can do this for me?

Thanks and Regards,

Aaron

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Aaron,

Use this coading to Clear all attribute of Node.

Data lo_node type ref to If_wd_context_node.

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

lo_node->invalidate( ).

This would clear all attribute value.

Regards,

Varun

Former Member
0 Kudos

Hi Varun,

does the method invalidate( ) just clear the attributes to default value. if the default value is not space,

The attributes value won't be set to space. in my case, the default value is not space, so do you have any other way to do that?

Thanks and Regards,

Aaron

Former Member
0 Kudos

Hi Aaron,

After using the method INVALIDATE(), may be for clearing the values of the field with default values(not null), you can try using method SET_ATTRIBUTE_NULL by passing index & attribute name.

This sets values of a attribute to NULL for a given row. If your node cordinality is 0:n or 1:n, you might have to do this for all the indexes(elements).

Regards,

Manne.