cancel
Showing results for 
Search instead for 
Did you mean: 

enhance search

Former Member
0 Kudos

hi all,

i have a requirement to enhance the standard search functionality ( i am not using the advanced search , but the normal one) .

what i need is to extend the search criteria with one more option. for example i have a drop down in the search criteria and i can select one value as a search criteria. but i have to combine two drop down values and the search functionality should search for both these values. do i need to enhance the search query itself ?

as i said i am not using the advanced search but the normal one.

please help.

regards,

nikita.

Accepted Solutions (1)

Accepted Solutions (1)

CarstenKasper
Active Contributor
0 Kudos

Hi Nikita,

I hope I got you correct.

The reason why SAP introduced the AdvancedSearches is exactly the point you mention: With normal queries you can only have "SEARCH CRITERIA = VALUE". The AdvancedSearches allow you to have multiple values with different operators for a single search criteria. You can compare it to PARAMETERS and SELECT-OPTIONS statement in ABAP reports.

The answer to your question is: No, you can not have multiple values for your search criteria in a normal search.

The way to go, if for whatever reason you do not like AdvancedSearches, in my opinion is to enhance the search structure and the implementation class of the search.

My suggestion would be to use a AdvancedSearch. This way you could supply select-option like your criteria. You would have to implement the search logic never the less.

cheers Carsten

Former Member
0 Kudos

hi,

thanks a lot for your reply. i have the following questions, please excuse if they dont make any sense

can i enahnce the structure CRMT_BUPA_IL_HEADER_SEARCH and add an existing parameter again ? so that in the eh_onsearch method i can hardcode the value for this duplicate parameter i added? so that i dont have to code the search logic again ( as it is present as standard )?

please help.

regards,

nikita.

former_member192716
Contributor
0 Kudos

Hi,

It doesnt make any sense adding an existing parameter to the structure.

If you want the search field to be displayed twice (not to add or remove fields dynamically), then you can add the parameters in do_init_context or do_prepare_output method of the controller class.

If your seach entity is a dquery entity (cl_crm_bol_dquery_service), then use method ADD_SELECTION_PARAM.


Data: lr_qs TYPE REF TO cl_crm_bol_dquery_service.

lr_qs = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).

 CALL METHOD lr_qs->add_selection_param
            EXPORTING
              iv_attr_name = 'OBJECT_ID'
              iv_sign      = lc_sign
              iv_option    = lc_option_eq
              iv_low       = lv_low.

Regards,

Arun

Former Member
0 Kudos

hi,

as i mentioned i am not using dquery and i dont want to use that b'cause the normal query service is already implemented and dont want to disturb that. but the one time requirement i have is to make the normal search functionlaity to search for multiple entries for a single search criteria.

any help with some sample code would be greately appreciated !

regards,

nikita.

former_member192716
Contributor
0 Kudos

Hi,

If it is a normal search using CL_CRM_BOL_QUERY_SERVICE, you cannot repeat search parameters. So you can either use CL_CRM_BOL_DQUERY_SERVICE or as you already mentioned you can add a new parameter to the structure and add it to the configuration with same description. I would suggest using dquery service.

Regards,

Arun

Edited by: Arun Kumar on Jun 29, 2010 10:41 AM

Answers (1)

Answers (1)

former_member192716
Contributor
0 Kudos

Hi,

You can add the increment/decrement ( +/- buttons ) to your search criteria through coding, using bsp:bee tags. But it is a bit complex idea implemting this. You can use the existing advancesearchcriteria, if possible.

1. Add increment/decrement buttons and assign onClick event handlers.

2. When user clicks + (plus) button, create reference to htmlb:dropdownbox and assign it to bsp:bee tag reference. This should be done decrement button to remove the added search field.

Regards,

Arun