Skip to Content
0
Former Member
Nov 20, 2013 at 10:47 AM

SAP-CRM Web UI F4 Help is not working

357 Views

Hi Experts,

I have created F4 help (SAP-CRM EHP 7.1)for POSTL_COD1 fields in standardaddress of BP_ADDR view. I have created one custom table "ZBPPOSTCODE" & Custom search help "ZBPPOSTCODE". The database table has fields :-

MANDT

PINCODE

POSTOFFICE

I want to create F4 help for Pincode field.

I have written the below written code in the GET_V_POSTL_COD1 method:-

DATA:
lv_fieldname TYPE name_komp,
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.

DATA: IV_NOPREFIX TYPE ABAP_BOOL,
IV_FIELDNAME_ALTERNATIVE TYPE NAME_KOMP,
IT_FIELDNAME_ADDITIONAL TYPE CRMT_ATTR_NAME_TAB.

DATA:
lv_fname_prefix TYPE string,
lv_idx_string TYPE string.

* determine prefix in case the F4 is called from a table view
IF iv_index IS INITIAL.
lv_fname_prefix = 'STRUCT'. "#EC NOTEXT
ELSE.
lv_idx_string = iv_index.
CONDENSE lv_idx_string.
CONCATENATE 'TABLE[' lv_idx_string ']' INTO lv_fname_prefix."#EC NOTEXT
ENDIF.

IF iv_noprefix = abap_true.
lv_fname_prefix = ''. "#EC NOTEXT
ENDIF.

* determine field name
IF iv_fieldname_alternative IS INITIAL.
lv_fieldname = 'PINCODE'. "#EC NOTEXT
ELSE.
lv_fieldname = iv_fieldname_alternative.
ENDIF.

* copy the F4 key attribute
IF lv_fname_prefix IS NOT INITIAL.
CONCATENATE lv_fname_prefix lv_fieldname INTO ls_map-context_attr SEPARATED BY '.'."#EC NOTEXT
ELSE.
ls_map-context_attr = lv_fieldname.
ENDIF.
ls_map-f4_attr = 'KEY'. "#EC NOTEXT

INSERT ls_map INTO TABLE lt_outmap.
INSERT ls_map INTO TABLE lt_inmap.

APPEND 'PINCODE' to it_fieldname_additional.

* copy further F4 attributes (description, etc.)
IF it_fieldname_additional IS NOT INITIAL.
READ TABLE it_fieldname_additional INDEX 1 INTO lv_fieldname.
IF iv_index IS INITIAL. " is attribute in a table?
* COUNTRY_TEXT should be a value attribute, then no prefix is necessary
ls_map-context_attr = lv_fieldname.
ELSE.
CONCATENATE lv_fname_prefix lv_fieldname
INTO ls_map-context_attr SEPARATED BY '.'. "#EC NOTEXT
ENDIF.
ls_map-f4_attr = 'VALUE'. "#EC NOTEXT
INSERT ls_map INTO TABLE lt_outmap.
ENDIF.

CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr
EXPORTING
iv_help_id = 'ZBPPOSTCODE' "#EC NOTEXT
iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_comp
iv_input_mapping = lt_inmap
iv_output_mapping = lt_outmap.

The values in F4 help are coming after selecting any value nothing is getting stored in the field POSTL_COD1