cancel
Showing results for 
Search instead for 
Did you mean: 

F4 Search help with internal table on a field

former_member182379
Contributor
0 Kudos

Hi,

   As in case of ABAP report with can provide the F4 values usign the internal tale with FM '  F4IF_INT_TABLE_VALUE_REQUEST;, with similar concept

can we provide the F4 help to a web UI field with GET_V_METHOD. As in standard, we have to create the search help and assign that in Web UI.

   As we want to display the values from internal table.

Regards,

Zafar

Accepted Solutions (1)

Accepted Solutions (1)

former_member210661
Active Contributor
0 Kudos

Hi zafar,

if you want to provide f4 help for a search view there is a method GET_DQUERY_DEFINITIONS

in that we can provide dropdown values and f4 help for search view.. and internal table values will be populated there itself.

snippet code for f4 help it might be help full to u..

FIELD-SYMBOLS : <fs_wa> TYPE crms_thtmlb_search_field_info.

  DATA:                wa_ddlb TYPE crms_thtmlb_search_ddlb_nvp,

                            wa_opr TYPE crm_thtmlb_search_operator,

                            lv_node TYPE REF TO cl_crm_bol_entity,

                            lr_value_help TYPE REF TO cl_crm_mktpl_vh_bol_proxy.

  READ TABLE rt_result WITH KEY field = 'EXTERNAL_ID' ASSIGNING <fs_wa>.

  IF sy-subrc = 0.

    <fs_wa>-help_id-help_id = 'CRM_MKTPL_CAMPAIGNID_GEN'" 'CRM_ORDER_BY_OBJECT_ID'.

    <fs_wa>-input_mapping-context_attr = 'EXTERNAL_ID'.

    <fs_wa>-input_mapping-f4_attr = 'EXTERNAL_ID'.

    <fs_wa>-output_mapping-context_attr = 'EXTERNAL_ID'.

    <fs_wa>-output_mapping-f4_attr = 'EXTERNAL_ID'.

  ENDIF.

  CREATE OBJECT lr_value_help

    EXPORTING

      ir_bol_abstr_bo = lv_node

      iv_fieldname    = 'EXTERNAL_ID'.

  lr_value_help->get_dquery_result( CHANGING cs_result = <fs_wa> ).

in the above iam  readding  'EXTERNAL_ID'  field instead of that you should loop the internal table data and passed into  <fs_wa>-field = wa_field name.

remaining process is same and find the link below

A Technical Guide About How to Implement the Basic Search Help in CRM WEB UI

Answers (2)

Answers (2)

former_member188346
Active Participant
0 Kudos

Hi Zafar,

Here is the answer to your question:

 

1) Create a class say ZABC_F4 that implements the IF_BSP_WD_CUSTOM_F4_CALLBACK interface.

2) Create method RETRIEVE_CUSTOM_VALUES with below parameters in that class:

CT_RESULTS_TAB Changing Type SHSVALTAB

IR_CUSTOM_REF Importing Type Ref To OBJECT

IS_SEARCH_HELP Importing Type SHLP_DESCR

3) Write logic for DB select here and put it in below code:

select * from abc into LT.

data:   ls_result LIKE LINE OF ct_results_tab.

   LOOP AT lt ASSIGNING <fs>.
    CLEAR ls_result.
    ls_result-key = <fs_>-field.
    ls_result-value = <fs_>-fieldtext.
    APPEND ls_result TO ct_results_tab.
  ENDLOOP.

 

4) Redefine the V-method for that attribute and put below code there:

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.
    

    ls_map-context_attr = 'STRUCT.attribute1'.
  ls_map-f4_attr =
'aaa'.
 
APPEND ls_map TO lt_intmap.

  ls_map-context_attr =
'STRUCT.attribute2'.
  ls_map-f4_attr =
'bbb'.
 
APPEND ls_map TO lt_outmap.

 
CREATE OBJECT rv_valuehelp_descriptor TYPE
    cl_bsp_wd_valuehelp_f4descr
   
EXPORTING
      iv_help_id        =
'(ZABC_F4)'
      iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_comp
      iv_input_mapping  = lt_inmap
      iv_output_mapping = lt_outmap.

5) Implement get P for value input, as you know.

Thats it.

Regards,

Bhushan

faisal_pc
Active Contributor
0 Kudos

Hi Zafar,

http://scn.sap.com/docs/DOC-40803

Thanks,

Faisal

faisal_pc
Active Contributor
0 Kudos

Code here:

data:G_O_F4 TYPE REF TO CL_CRM_UIU_DDLB,

data: ls_value      TYPE bsp_wd_dropdown_line,

lt_ddlb       TYPE bsp_wd_dropdown_table.

if g_o_f4 is not bound.

    create object g_o_f4

      exporting

        iv_source_type = ''t'.

   loop at internal table into work area.

      ls_value-key      = work area-key.

      ls_value-value = work area-value.

        insert ls_value into table lt_ddlb.

      endloop.

g_o_f4->set_selection_table( it_selection_table = lt_ddlb ).

endif.