cancel
Showing results for 
Search instead for 
Did you mean: 

Search Page: Search Attributes customization

devendervb
Contributor
0 Kudos

Hi All.

we have a basic requirement.

On a Product Search page. For the Search Attribute eg. Configurable, for this by default we have search criteria as is, is not, start with, ... like that, how to restrict this criteria to eg: only is.

And how to set a particular value eg: Yes/NO to selected value.

Regards,

Devender

Accepted Solutions (1)

Accepted Solutions (1)

ajaya_kumar
Active Participant
0 Kudos

Hi Devender,

You can use the view cluster CRMVC_DQ in sm34 transaction to configure the search operator as per your requirement.

If you bydefault want to set the value of a search attribute ...may be you can try add_selection_parameter in Do_init_context(), just give a try.

I hope this helps!

Regards

Ajay

devendervb
Contributor
0 Kudos

Hi Ajay,

The answer is some how ocrrect for standard attributes, but we have a customized attribute.

Kindly, let me know how to resolve this.

Regards,

Devender V

ajaya_kumar
Active Participant
0 Kudos

Hi,

I think you need to add your custom attributes in the above mentioned view cluster and then you can configure the data. In my case I have enhanced the opportunity search with some cusotm attributes through EEWB. Now I can see these attributes available in this view cluster that means if i want i can add these attributes and control the search operator for these attributes.

May be you can try the same.

Cheers,

Ajay

former_member193352
Active Contributor
0 Kudos

Hello Devender,

In your search view class, there must be a method: GET_DQUERY_DEFINITIONS

You need to redefine this method. Following is the sample code to do this:


  CALL METHOD super->get_dquery_definitions
    RECEIVING
      rt_result = rt_result.

  LOOP AT rt_result ASSIGNING <rt_result>.

    IF    <rt_result>-field  = 'ZZ......'

      CLEAR: lt_operators[], ls_result.
      ls_result-field = <rt_result>-field .
      ls_result-operators = <rt_result>-operators.
      lt_operators[] = ls_result-operators[].
      DELETE TABLE lt_operators WITH TABLE KEY table_line = 'NE'.
      ls_result-operators[]  = lt_operators[].
      <rt_result>-operators  = ls_result-operators.

    ENDIF.
  ENDLOOP.

In this code, I have removed Not Equal To operator from the list for attribute ZZ..... You can implement similar code as per your requirement.

Thanks

Vishal

devendervb
Contributor
0 Kudos

Hi Vishal,

This is very helpful answer, we have one more requirement.

This is a custom attribute say Current series. As a general if we pass Value X to product search criteria it works. The requirement is, On a WebUI we need 'Yes' and 'No' options. for Yes we have to pass 'X' at the back end.

Kindly, help.

Regards,

Devender V

former_member193352
Active Contributor
0 Kudos

Hello Devendra,

In this case, you need to build the dropdown value help for this custom attribute.

Redefine the GET_P method of this custom attribute and implement this code:


  CASE iv_property.
    WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
      rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.
  ENDCASE.

The above code is to make this field as dropdown help type.

After this, Redefine the GET_V method of this attribute and implement this code:



DATA: ls_ddlb        type bsp_wd_dropdown_line,
lt_ddlb        type bsp_wd_dropdown_table,
gr_ddlb       type ref to CL_CRM_UIU_DDLB.


      ls_ddlb-key   = 'X'.
      ls_ddlb-value = 'Yes'.
      insert ls_ddlb into table lt_ddlb.

      ls_ddlb-key   = ' '.
      ls_ddlb-value = 'No'.
      insert ls_ddlb into table lt_ddlb.

  if not gr_ddlb is bound.
    create object gr_ddlb
      exporting
        iv_source_type = 'T'.
  endif.

  gr_ddlb->set_selection_table( it_selection_table = lt_ddlb ).

  rv_valuehelp_descriptor = gr_ddlb.

Hope this helps.

Thanks

Vishal

Answers (1)

Answers (1)

former_member191572
Contributor
0 Kudos

Hi,

There is another possibilty of doing the same through coding.. for that u need to do the changes in the method dquery definition in repect searc view impl class.