cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear the table contents for the new selection values?

Former Member
0 Kudos

Hi,

Im developing some very basic web dynpro applications.I have created one application to demonstrate use of SERVICE CALL.Now in one of the COntext Nodes,I have one attributes as TABLE.I have 2 input fields and when i enter any sel critteria in these 2 fields,the table is populated accordingly.Now when i change the value in the input fields,the new output gets appended in the output TABLE.How do I clear the contents of the OUTPUT table attribute in the method?

Can someone tell me the common methods used with context nodes like REFRESHING,CLEARING etc?How do I know which methods to call for what action of the nodes ...like for binding internal table to any context node we use the method BIND_TABLE...

Any inputs will be highly appreciated.

Thanks!

BR,

SRM tech.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To clear the contents of the node, use invalidate method.

data: l_node type ref to if_wd_context_node.
l_node  = wd_context->get_child_node( 'NODENAME' ).
l_node->invalidate( ). " all the data in the node will be cleared

To clear a single attribute you can use set_attribute_null.

Regards,

Radhika.

Former Member
0 Kudos

Thanks so much Radhika for that repky..It worked!

Can you give me an example with sample code to use set_attribute_null.

THANKS AGAIN!

-SRM Tech

Former Member
0 Kudos

Hi,

DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
 
* get element via lead selection
  lo_el_context = wd_context->get_element( ).
 
** get single attribute
  lo_el_context->set_attribute_null(
    EXPORTING
      name =  `ATTRIBUTE NAME` 
 ).

Radhika

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

As your are developing basic application, one more way of clearing the values is

1) Double click on the view

2) Go to Properties tab

3) Change the Lifetime property to WhenVisible

Best Regards,

Chaitanya.A