Skip to Content
avatar image
Former Member

clearing the select-option field

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 01, 2009 at 05:45 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 01, 2009 at 05:31 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Jun 01, 2009 at 05:29 AM

    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

    Add comment
    10|10000 characters needed characters exceeded