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

Re: default value for a search parameter in web UI

$
0
0

Hi Madhukar,

 

if you want to provide the default date whenever you launch the search view.. you have to write the logic in DO_INIT_CONTEXT method this will trigger at first time when you launch the your view in web ui.

 

sample code :

lr_current ?= me->typed_context->searchcn->collection_wrapper->get_current( ).

 

   lr_qs_col ?= lr_current->get_selection_params( ).

   lr_iter ?= lr_qs_col->get_iterator( ).

   CHECK lr_iter IS BOUND.

* Set parameters only fof the initial load

    lv_date = sy-datum.

   lv_low = 30 - sy-datum.

   lr_dq_entity ?= lr_iter->find_by_property( iv_attr_name = 'STARTDATE' iv_value = lv_date ).

   IF lr_dq_entity IS BOUND.

     lr_dq_entity->set_property_as_string( iv_attr_name = 'SIGN' iv_value = 'I' ).

     lr_dq_entity->set_property_as_string( iv_attr_name = 'OPTION' iv_value = 'BT' ).

     lr_dq_entity->set_property_as_string( iv_attr_name = 'LOW' iv_value = lv_date ).

   ELSE.

 

*   lr_current->add_selection_param( iv_attr_name = 'POSTING_DATE'

*                                iv_sign      = v_sign

*                                iv_option    = v_option

*                                IV_LOW       = ' '

*                                IV_high       = ' ' ).

     lr_current->add_selection_param( iv_attr_name = 'STARTDATE'

                                 iv_sign      = v_sign

                                 iv_option    = v_option

                                 IV_LOW       = lv_low

                                 IV_high       = lv_date ).

   ENDIF.


Try this...


Regards,

Srinivas.


Viewing all articles
Browse latest Browse all 8501

Trending Articles



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