Skip to Content

invalidate( ) doesn't invalidate child nodes

Hello everyone,

I've created context nodes dynamically through:

            new_node = node_info->add_new_child_node( name = nodename
                                           is_singleton = abap_false
                                           is_multiple = abap_false
                                           is_mandatory = abap_true
                                           is_initialize_lead_selection = abap_true
                                           is_static = abap_false ).

I've then invalidated the parent node through:

   lo_nd_contract = wd_context->path_get_node( path = `CONTRACT` ).
  lo_nd_contract->invalidate( ).
  lo_nd_contract = wd_context->path_get_node( path = `CONTRACT.COMPANY_CONTACTS.COMPANY_CONTACT_1` ).
  lo_el_contract  = lo_nd_contract->get_element( ).
      lo_el_contract->get_attribute(
                EXPORTING
                  name =  `COMPANY_CONTACT_1`
                IMPORTING
                  value = lv_company_contact_0 ).

but the variable lv_company_contact_0 still retains the old value.

Any ideas as to what's going on?

Thank you!

Edited by: Development Themis on May 3, 2011 6:25 PM

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 03, 2011 at 07:24 PM

    Hi,

    does any of these nodes CONTRACT.COMPANY_CONTACTS.COMPANY_CONTACT_1 have supply function ?

    This method invalidates all elements of the node. This means that all elements and subnode

    instances are deleted. Afterwards the status of the node is as it is in its initial state. When an

    element or an attribute is requested again, the supply method is called, if it is available.

    Add a comment
    10|10000 characters needed characters exceeded

    • I've fixed the problem.

      > The thing is that I created the node as

       is_mandatory = abap_true 

      and the node was not deleted (actually it disappeared from the context in the Debug but appeared back in whenever I tried to access it).

      If you understand the purpose of these properties while creating dynamic nodes , you will not run into issues again.

      IS_MENDATORY --> Used to specify lower canrdinality

      IS_MULTIPLE --> used to specify higher cardinality

      So by specifying is_mandatory = abap_true , you had set lower cardinality to 1 and that caused the problem.

      Regards,

      Ashish Shah

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.