Skip to Content
0
Former Member
Feb 12, 2009 at 12:31 PM

How to create a Picklist for a Srch-Field that was added to BP_HEAD_SEARCH?

727 Views

Hi experts,

I've enhanced the BP_HEAD_SEARCH with the field SALES_OFFICE from BP_SALES. For more information about this, please refer to my previous thread where I asked how to do that:

I can search for SALES_OFFICE but the request now is to use a Picklist instead, just like in BP_SALES in View CorpAccountOrgEF.

To add the field SALES_OFFICE to the BP_HEAD_SEARCH I had to add it to the structure CRMT_BUPA_IL_HEADER_SEARCH.

There it is in include CI_EEW_BUT000 as ZZSALES_OFFICE with the same Data Element as its original (CRMT_SALES_OFFICE).

So when I look at BP_HEAD_SEARCH/MainSearch in the Component Workbench - ZZSALES_OFFICE is in the SEARCH Context Node as attribute STRUCT.ZZSALES_OFFICE.

For that attribute I've generated the GET_P and GET_V methods and added below coding.

method get_p_zzsales_office.

  case iv_property.
    when if_bsp_wd_model_setter_getter~fp_fieldtype.
      rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.
  endcase.

endmethod.

method get_v_zzsales_office.
  data: lt_ddlb          type bsp_wd_dropdown_table,
        ls_sales_area    type crmt_bus_sales_area,

        lt_partner_crm   type table of crmmspl_bp_l0011,
        ls_partner_crm   type          crmmspl_bp_l0011,
        lr_ddlb_type     type ref to   cl_crm_uiu_ddlb.


* get sales area
  select distinct sales_org channel division from crmmspl_bp_l0011
         into corresponding fields of table lt_partner_crm.
  read table lt_partner_crm into ls_partner_crm index 1.
  move-corresponding ls_partner_crm to ls_sales_area.

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

*   Get values for SALES_OFFICE
*   provide sales area
    call method cl_crm_uiu_bp_cust_get=>get_val_for_sales_office
      exporting
        is_sales_area  = ls_sales_area
      receiving
        rt_value       = lt_ddlb
      exceptions
        error_occurred = 1
        others         = 2.
    append initial line to lt_ddlb.
    if sy-subrc = 0.
      lr_ddlb_type->set_selection_table( it_selection_table = lt_ddlb ).
    endif.
  endif.

  rv_valuehelp_descriptor = lr_ddlb_type.
endmethod.

But I still don't get a Picklist for my ZZSALES_OFFICE. None of these methods are even called - which I found out through debugging.

Does anyone have an idea on how to do this?

Thanks in advance!

Best regards,

Melanie

Edited by: Melanie Lauber on Feb 12, 2009 1:33 PM