Assigning a Search Help for a field in CRM Web UI

Problem: you have a field in CRM Web UI and you want to show Search Help on it.

Solution: you need to generate a V-Getter method for the field. In this method, you need to paste the code presented below.

  DATA:
    ls_map TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
    lt_inmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
    lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
    lo_value_help TYPE REF TO cl_bsp_wd_valuehelp_f4descr.
 
  ls_map-context_attr = NAME_OF_FIELD_FROM_CONTEXT.
  ls_map-f4_attr = NAME_OF_FIELD_FROM_SEARCH_HELP.
 
* LT_INMAP contains mappings for importing Search Help fields
  APPEND ls_map TO lt_inmap.
 
* LT_OUTMAP contains mappings for exporting Search Help fields
  APPEND ls_map TO lt_outmap.
 
  CREATE OBJECT lo_value_help
    EXPORTING
      iv_help_id        = NAME_OF_SEARCH_HELP
      iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name
      iv_input_mapping  = lt_inmap
      iv_output_mapping = lt_outmap.
 
  rv_valuehelp_descriptor ?= lo_value_help.
  DATA:
    ls_map TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
    lt_inmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
    lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
    lo_value_help TYPE REF TO cl_bsp_wd_valuehelp_f4descr.

  ls_map-context_attr = NAME_OF_FIELD_FROM_CONTEXT.
  ls_map-f4_attr = NAME_OF_FIELD_FROM_SEARCH_HELP.

* LT_INMAP contains mappings for importing Search Help fields
  APPEND ls_map TO lt_inmap.

* LT_OUTMAP contains mappings for exporting Search Help fields
  APPEND ls_map TO lt_outmap.

  CREATE OBJECT lo_value_help
    EXPORTING
      iv_help_id        = NAME_OF_SEARCH_HELP
      iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name
      iv_input_mapping  = lt_inmap
      iv_output_mapping = lt_outmap.

  rv_valuehelp_descriptor ?= lo_value_help.

Komentowanie jest zakończone.