cancel
Showing results for 
Search instead for 
Did you mean: 

DDLB for search criteria

Former Member
0 Kudos

Hi,

I have added a search criterion 'IBU' for searching oppurtunities.Now when i select the search criterion IBU i want a dropdown for it to select the value of IBU.The value for search criteria appears in the field VALUE1 of context node search which is in the component BT111S_OPPT/Search .How do i code for getting a dropdown for this?

Thanks in advance:)

Regards

Shilpi

Accepted Solutions (1)

Accepted Solutions (1)

FabianJ
Active Participant
0 Kudos

Hi Shilpi,

This is done in the method GET_DQUERY_VALUEHELPS (redefine) of the context node (in your case: ZL_BT111S_OPPT_SEARCH_CN00)

METHOD get_dquery_valuehelps.

  DATA: lt_ddlb         TYPE bsp_wd_dropdown_table.
  DATA: ls_ddlb         LIKE LINE OF lt_ddlb.
  DATA: ls_string_ddlb  TYPE crms_thtmlb_search_ddlb_nvp.

  FIELD-SYMBOLS: <rs_result> LIKE LINE OF rt_result.

  CONSTANTS lc_string_empty TYPE crms_thtmlb_search_ddlb_nvp VALUE IS INITIAL.

  CALL METHOD super->get_dquery_valuehelps
    RECEIVING
      rt_result = rt_result.

  LOOP AT rt_result ASSIGNING <rs_result>.
    CASE <rs_result>-field.
      WHEN 'XXX'.

        CALL METHOD cl_crm_uiu_bp_cust_get=>get_val_for_xxx
          EXPORTING
            iv_nofilter = abap_true
          RECEIVING
            rt_value    = lt_ddlb.

        CLEAR <rs_result>-ddlb_options.

        SORT lt_ddlb BY value ASCENDING.
        APPEND lc_string_empty TO <rs_result>-ddlb_options.

        LOOP AT lt_ddlb INTO ls_ddlb.
          ls_string_ddlb-key   = ls_ddlb-key.
          ls_string_ddlb-value = ls_ddlb-value.
          APPEND ls_string_ddlb TO <rs_result>-ddlb_options .
        ENDLOOP.

    ENDCASE.
  ENDLOOP.

ENDMETHOD.

Important lines:

- WHEN 'XXX'.

=> XXX is the your IBU field name

- cl_crm_uiu_bp_cust_get=>get_val_for_xxx

=> to retrieve possible values

Regards,

Fabian

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Here is a brief approach for starters:

For this requirement you have to enhance the component.When you enhance it the Z version of the component gets created.Go to se80 and open that Zapplication

and in the view you can code for the dropdown menu.For displaying the values create a temperary table and pass some values for it.Now in eh_onssearch method you can read the value passed and enter this value in the search query.

Thanks,

'Ashish