Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8453

Re: Adding selection params to advanced search page

$
0
0

Hi,

first you need get selection parameter and if you parameter is not there in search field then add using add_selection_parameter and then after search remove using coll remove from selection parameter collection.

 

refre below code

 

lr_qs ?= me->typed_context->search->collection_wrapper->get_current( ).
* Assign selection parameters to internal table
  lr_qs_col ?= lr_qs->get_selection_params( ).
  lr_param_ent = lr_qs_col->get_first( ).
  WHILE lr_param_ent IS BOUND.
    lr_param_ent->get_properties( IMPORTING es_attributes = ls_fields ).
    APPEND ls_fields TO lt_fields.
    lr_param_ent = lr_qs_col->get_next( ).
  ENDWHILE.

 

READ TABLE lt_fields INTO ls_fields WITH KEY attr_name = 'PROCESS_TYPE' low = 'value'.
    IF sy-subrc IS NOT INITIAL.
CALL METHOD lr_qs->add_selection_param
        EXPORTING
          iv_attr_name = 'PROCESS_TYPE'
          iv_sign      = 'I'
          iv_option    = 'EQ'
          iv_low       = 'value'.
ENDIF.

 

super class search call

after search call (super class search) remove your parameter

 

lr_qs_col ?= lr_qs->get_selection_params( ).
    lr_param_ent = lr_qs_col->get_first( ).
    WHILE lr_param_ent IS BOUND.
      lr_param_ent->get_properties( IMPORTING es_attributes = ls_fields ).
      IF ls_fields-attr_name = 'PROCESS_TYPE' AND ls_fields-low IS NOT INITIAL.
        lr_qs_col->remove( lr_param_ent ).
      ENDIF.
      lr_param_ent = lr_qs_col->get_next( ).
    ENDWHILE.

 

Regards,

Deepika.


Viewing all articles
Browse latest Browse all 8453

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>