Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

DDLB for search criteria

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

Tags:
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question