Skip to Content
avatar image
Former Member

Node Refresh in Webdynpro ABAP

Dear Experts,

I have a 'Back' Button in which I need to refresh a populated node.

Could anyone provide me the code to refresh the already populated node ??

Regards,

Parama Laha.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    May 02, 2011 at 03:29 PM

    Hi ,

    You can also set the node as empty.

    pass the attributes as null as set_static_attributes = ' ' . for a node or if you have a table bind the lt_table where lt_table is empty.

    This might help you out.

    Regards

    Kuldeep

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 07, 2014 at 02:03 PM

    Hi there.

    I know this thread is quite old, but should it help...

    To me, best practice is simply to set the internal table to empty, and then use the append as a table method to bind the internal table to the node.

    Code would be like this:

    DATA lo_nd_node TYPE REF TO if_wd_context_node.
    DATA ls_node TYPE wd_this->Element_node.
    DATA lt_node TYPE wd_this->Elements_node.

    * navigate from <CONTEXT> to <NODE> via lead selection

    lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).

    clear ls_node.

    append ls_node to lt_node.

    lo_nd_reference->bind_table( new_items = lt_reference set_initial_elements = abap_true ).

    End of the game.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 29, 2011 at 02:15 PM

    What you mean by refresh ?

    You can invalidate the node if it is binded by Supply function then supply function would be called.

    data:
       lo_nd_sflight      type ref to if_wd_context_node,
       lt_sflight            type wd_this->elements_sflight.
    
    lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).
    
    lo_nd_sflight->invalidate( ).
    
    "Or you can bind a new table with data (original date )
    
    lo_nd_sflight->bind_table( new_items = lt_sflight ).

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Like i already said , if it is not the supply function then you can bind the node with old data.

      data:
         lo_nd_sflight      type ref to if_wd_context_node,
         lt_sflight            type wd_this->elements_sflight.
       
      lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ). 
      lo_nd_sflight->bind_table( new_items = lt_sflight ).

      In this case lt_sflight table should have the old data. You can save the original table in the controller attribute, when you press the back key, assign the reference of the controller attribute to lt_sflight.

      lt_sflight = wd_this->gt_sflight.

      and you the above code snippet . The key point is that you should supply the old data for the node.

  • avatar image
    Former Member
    Apr 29, 2011 at 02:35 PM

    Hi ,

    You can write the code to invalidate the node in your back method ie then when your back event is fired ie when you back button is pressed put the code to invalidate the node in it.

    regards

    Kuldeep

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Kuldeep,

      Just the invalidate code is not helping when I dont have supply function in my code.

      lo_nd_addressdetails->invalidate( ).

      Please guide.