cancel
Showing results for 
Search instead for 
Did you mean: 

Node Refresh in Webdynpro ABAP

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

Former Member
0 Kudos

I This this Solution ist ne cleanest one thx

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Kuldeep,

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

lo_nd_addressdetails->invalidate( ).

Please guide.

Former Member
0 Kudos

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 ).

Former Member
0 Kudos

Hi Senthil,

Thanks for the response.

But I have a simple node to refresh .

I dont have any supply function involved.

Please guide.

Former Member
0 Kudos

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.