cancel
Showing results for 
Search instead for 
Did you mean: 

Search parameter's got disable after clear

Former Member
0 Kudos

Hi Guys,

I have created a "CLEAR" button in search view to clear search and result fields, it is working fine but problem is that once it clears the values then Search parameters got disable and user is not able to provide further search criteria on it.

Can anyone let us know how can I make it enable after clearing all parameter so that user can input further search criteria?

I am using below code to clear the search parameter's:

data: Lr_ent type ref to IF_BOL_BO_PROPERTY_ACCESS.

LR_ENT ?= me->typed_context->search->collection_wrapper->clear( ).

Regards

Nittu

Accepted Solutions (1)

Accepted Solutions (1)

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

You should not clear the search collection wrapper. you should clear Search paramenter low - high values and result collection. You can see EH_ONCLEAR event in any standard Search component .

qs ?= me->typed_context->search->collection_wrapper->get_current( ).

* clear the selection parameter collection....
  CALL METHOD qs->get_selection_params
    RECEIVING
      rv_result = lr_selparam_col.

  lr_iterator = lr_selparam_col->get_iterator( ).
  lr_param = lr_iterator->get_first( ).
  WHILE lr_param IS BOUND.
    lr_param->get_properties( IMPORTING es_attributes = ls_param ).
    IF ( ls_param-low  IS NOT INITIAL ) OR
       ( ls_param-high IS NOT INITIAL ).
      CLEAR: ls_param-low, ls_param-high.
      lr_param->set_properties( EXPORTING is_attributes = ls_param ).
    ENDIF.

    lr_param = lr_iterator->get_next( ).
  ENDWHILE.

Regards,

Deepika .

Answers (1)

Answers (1)

sumeet_gehlot
Contributor
0 Kudos

Hi,

I think u should use only

me->typed_context->search->collection_wrapper->clear( ).


Regards,

Sumeet

Former Member
0 Kudos

Hi Sumeet,

It also don't work. Please suggest.

Regards

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

Refer standard Search Component BT111S_OPPT/Result View EH_ONCLEAR method you will get some idea.

Regards,

Deepika C.