cancel
Showing results for 
Search instead for 
Did you mean: 

Pointers needed to provide Wild card search on F4 Help on Web UI

former_member184390
Participant
0 Kudos

Hi All,

We have a requirement where in customer likes to have a wild card search feature on Industry Sector Value help field. Say for example, i have given A* then the value help should show the entries starting with A only. Any pointers on how to achieve this functionality will be great.

Initally, Industry sector was a dropdown field, we have changed it to Value help by changing the attribute property in P Getter method and in GET_V_STRUCT we have written the logic to show the values .



DATA: ls_tabname        TYPE ddobjname,
       ls_fieldname      TYPE fieldname.
 DATA: lr_object_model   TYPE REF TO if_genil_obj_model.
 DATA: lt_inmap		   TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
lt_outmap    		   TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.
 me->ddlb_threshold = '0'. "0: DDLB n: 1-n:, DDLB >n: F4-Popup


  	IF component = 'INDUSTRY'.
        CREATE OBJECT rv_valuehelp_descriptor
        TYPE cl_bsp_wd_valuehelp_f4descr
        EXPORTING
iv_help_id       = 'CRMT_BUS_FRG0040-INDUSTRY'        iv_help_id_kind  = if_bsp_wd_valuehelp_f4descr=>help_id_kind_comp
         iv_input_mapping = lt_inmap
    	    iv_output_mapping = lt_outmap.
     ENDIF.

But for standard Value help attributes, wild card search is supported and the same is not workin in case of Industry Sector. Any pointers on this would be great.

Thanks,

Udaya

Edited by: Udaya Bhaskar Perecharla on Sep 8, 2008 12:53 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member184390
Participant
0 Kudos

Issue is still persisting.

former_member184390
Participant
0 Kudos

Hi All,

I am facing an issue in populating Industry Sector attribute. My requirement is to show the value help based on Description and once the user selects the row in the Value Help pop up, i need to set the Key in the screen attribute. I will try to explain with an example, i get the following list of values on clicking Industry sector F4 Button on WEB UI.

0001 Dell

0002 Sap

0003 Siebel

In the screen, if i type S* Then i shouldget SAP & Siebel and on row selection it should populate the key(0002) and not Description(SAP).

I was able to get wild card search and show the relevant entries in the popup, but on selecting the value it is placing the Description instead of Key in the UI.

PFB the code i used for this. Any pointers on how to approach this req will be really helpful. I am trying ou to retireve selected row Key, Description and by using Set method trying to set the Key instead of Desc on the UI. But i am not finding how to retrieve the same.

i was able to provide the wild card search on Description by below code.Here i have given Value instead of key.

ls_map-f4_attr = 'VALUE'. "#EC NOTEXT

INSERT ls_map INTO TABLE lt_inmap.

INSERT ls_map INTO TABLE lt_outmap.


method GET_V_INDUSTRY.
*DATA: 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:
   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 BOOLEAN VALUE  ABAP_FALSE,
      IV_FIELDNAME_ALTERNATIVE TYPE NAME_KOMP,
     It_fieldname_additional TYPE crmt_attr_name_tab.

      Lv_fieldname = 'INDUSTRY'.                            "#EC NOTEXT
      INSERT Lv_fieldname INTO TABLE It_fieldname_additional.
  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 = 'INDUSTRY'.                               "#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 = 'VALUE'.                                   "#EC NOTEXT
  INSERT ls_map INTO TABLE lt_inmap.
  INSERT ls_map INTO TABLE lt_outmap.

* 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        = 'CRMT_BUS_FRG0040-INDUSTRY'      "#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.

xavier_dehairs2
Active Participant
0 Kudos

Hi, have you tried to use KEY instead of VALUE for your lt_outmap table ?

So doing that:

ls_map-f4_attr = 'KEY'. "#EC NOTEXT

INSERT ls_map INTO TABLE lt_outmap.

Tell me if this is ok or not ?

Xavier

former_member184390
Participant
0 Kudos

Hi Xavier,

I tried giving Key and still showing Description in the Screeen.

Thanks for your time.

Regards,

udaya

xavier_dehairs2
Active Participant
0 Kudos

And if you try to put "INDUSTRY" in your F4_ATTR, what happens ?

Otherwise, just post again the full code you are using actually and also the view and component so i can try this myself.

Xavier

former_member184390
Participant
0 Kudos

Hi Xavier,

Thanks for your help. PFB the details.

Component : BP_HEAD

View : Account Details

Context Node: Marketing

Attribute : Industry

PFB the cod i have placed in GET_P_INDUSTRY

method GET_P_INDUSTRY. CASE iv_property. WHEN if_bsp_wd_model_setter_getter~fp_fieldtype. rv_value = cl_bsp_dlc_view_descriptor=>FIELD_TYPE_INPUT. ENDCASE. endmethod.

Code in Get_v_industry


method GET_V_INDUSTRY.

*DATA: 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:
   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 BOOLEAN VALUE  ABAP_FALSE,
      IV_FIELDNAME_ALTERNATIVE TYPE NAME_KOMP,
     It_fieldname_additional TYPE crmt_attr_name_tab.

      Lv_fieldname = 'INDUSTRY'.                            "#EC NOTEXT
      INSERT Lv_fieldname INTO TABLE It_fieldname_additional.


  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 = 'INDUSTRY'.                               "#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 = 'VALUE'.                                   "#EC NOTEXT
  INSERT ls_map INTO TABLE lt_inmap.
  ls_map-f4_attr = 'KEY'.
  INSERT ls_map INTO TABLE lt_outmap.

* 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        = 'CRMT_BUS_FRG0040-INDUSTRY'      "#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.
endmethod.

Thanks again for your time.

Regards,

Udaya

xavier_dehairs2
Active Participant
0 Kudos

Hi, I just copy/pasted the code you sent in my system, and it work perfectly well ! I retrieve the Key and not the description.

So what i did is just implementing the GET_P and GET_V method for the attribute INDUSTRY and on the view, when i click the search help, both key and values are displayed, then if i click on an entry, the key is copied to the view.

So i really don't know what is going wrong on your side !

Have you restarted your web client after your different changes ??? Just in case

Xavier

former_member184390
Participant
0 Kudos

Hi Xavier,

We need to provide wild card search on Description and on selecting the value it should place Key and not Description.

Can you try giving wild card search with Description, i guess it will not work.

The below lines of codes is controlling the functionality.

ls_map-f4_attr = 'VALUE'. "#EC NOTEXT

INSERT ls_map INTO TABLE lt_inmap.

ls_map-f4_attr = 'KEY'.

INSERT ls_map INTO TABLE lt_outmap.

awaiting your response..

Regards,

udaya

xavier_dehairs2
Active Participant
0 Kudos

Of course it does not work, and also the field on the view only accepts 4 characters, since this is the key length !

In your case, what is behind the field INDUSTRY is a simple value table with only one field coming from CRMC_INDUSTRY and the description comes from CRMC_INDUSTRY_T.

So basically for what you need, you should first have a field on the view which is longer than the actual one to allow you to add more than 4 characters, then you also need to create your own search help in SE11 based on the 2 above tables to allow you to enter a description as input parameter and return the key as output parameter.

Good luck with that !

Xavier

former_member184390
Participant
0 Kudos

Hi Xavier,

Thanks a lot for your help. Now i am working out with your idea. I am creating a new elementary search help and added two attributes Industry, Description and marked as Export parameters and in the Data Collection i have given CRMC_INDUSTRY_T. Now in the program i have updated the help id to the search help.

In the UI, i am getting a search help and nothing is happening. I am missing some thing here.. or i have done completely wrong..Can you just tel me wat is the expected procedure at yur convenient time.

Thanks a lot.

Regards,

udaya

CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr

EXPORTING

  • iv_help_id = 'CRMT_BUS_FRG0040-INDUSTRY' "#EC NOTEXT

iv_help_id = 'ZINDUSTRYSECTOR' "#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.

Regards,

udaya

xavier_dehairs2
Active Participant
0 Kudos

In the case of a custom search help, you need to replace

iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_comp

by

iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name

Regards,

Xavier

PS: Do not forget to give some points if it is helpfull

former_member184390
Participant
0 Kudos

Hi Xavier,

I changed and still it is not working. The selected row is not getting setted and the wild card search is not working,instead it is displaying a search window with all values.

I am going wrong here..anyways really appreciate your help.

Thanks for the help on clearing search criteria. it worked.

Regards,

udaya

former_member184390
Participant
0 Kudos

Hi,

I am stuck at final step. I have created a custom search help. i have given the search help in the program,still the wild card searc is not supported on pressing f4 icon and also The selected row is not getting setted I am going wrong here.. really appreciate your help.

Regards,

udaya

xavier_dehairs2
Active Participant
0 Kudos

Hi, I will need to see your code again to try helping you on this.

Regards,

Xavier

former_member184390
Participant
0 Kudos

Hi Xavier,

Thanks a lot. The issue is resolved now.

Regards,

Udaya

Former Member
0 Kudos

Hi,

I'm having a similar problem: the F4-help is shown but the wildcards are not working and when I select a line from the F4-help, the value is not tranferred to the field.

Anyone having an idea?

Here is my code (the search help is added to a field 'UOM' on a table) and the search help i'd like to use is a standard seach help H_T006.

DATA:

lv_str_index TYPE string,

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.

lv_str_index = iv_index.

CONCATENATE 'table[' lv_str_index '].uom' INTO ls_map-context_attr.

ls_map-f4_attr = 'MSEHI'.

APPEND ls_map TO: lt_inmap, lt_outmap.

CREATE OBJECT rv_valuehelp_descriptor

TYPE

cl_bsp_wd_valuehelp_f4descr

EXPORTING

iv_help_id = 'H_T006'

iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name

iv_input_mapping = lt_inmap

iv_output_mapping = lt_outmap.

Many thanks!

Former Member
0 Kudos

Hi Udaya,

I am facing the same problem.

Not able to search by wildcard & Also not getting the selected value set to the field.

I am using a custom search help.

Thanks in advance!

Regards,

Tarak

Former Member
0 Kudos

hi Uday,

how did you solved this issue.

i am also stuck at a final step.and m not able to populate the data in f4.

please help.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all,

How will I implement wild card search for the field STRUCT.INDUSTRY in CRM WEB UI?

I used the code to bring search help...But wild card search is not working??

CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr

  • EXPORTING

  • iv_help_id = 'CRMT_BUS_FRG0040-INDUSTRY' "#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

  • iv_trigger_submit = abap_true.

PLZ help.

Former Member
0 Kudos

Hi all,

I resolved the solution.

former_member184390
Participant
0 Kudos

Solved.