cancel
Showing results for 
Search instead for 
Did you mean: 

clearing the select-option field

Former Member
0 Kudos

Hi all,

i've got 4 selection-screen fields

when user clicks on search o/p will come....

i've got one more button CLEAR when it is clicked it should clear the values enterd in select-option fied.

please help me how to do this...

i've alrady used INVALIDATE statement. this will not work

regards

Suprith

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I don't know if you have done this or not but please make sure that your CLEAR action is VALIDATION INDEPENDENT. It will make sure that all fields get cleared even if there is some type check error from WD framework. for ex: characters in date field.

Thanks,

Rahul

Answers (2)

Answers (2)

former_member40425
Contributor
0 Kudos

Use method set_attribute_null in the event handler of clear.

DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
  DATA lv_att1 TYPE wd_this->element_context-attribute_name. "Name of attribute is Attribute_name
 
* get element via lead selection
  lo_el_context = wd_context->get_element( ).
 
  lo_el_context->set_attribute_null(
    name   = `ATTRBUTE_NAME`)." Give ur attribute name here

I hope it helps.

Regards,

Rohit

Former Member
0 Kudos

Hi,

The method INVALIDATE of of the context node interface, which cannot be used here. You need to use the method "IF_WD_SELECT_OPTIONS~RESET_ALL_SELECTION_FIELDS".This method will clear all the selection screen fields that you have on the UI. Just make sure that you are calling this method with the correct reference variable, the one which you used to create a select option.

Call this above mentioned method in the action handler method of the clear button that you have.

Hope this helps.

Best Regards,

Ashish

Former Member
0 Kudos

Hi,

If you have used the WDR_SELECT_OPTIONS component to create selection screen then you can use the standard RESET option provided by this component to clear the fields.

If not, then you need to clear the nodes/attributes which are bound to the selection screen fields and bind initial (null) values to the nodes/attributes bound to the select option fields.

Thanks,

Abhishek

Edited by: abhishek sinha on Jun 1, 2009 7:29 AM