cancel
Showing results for 
Search instead for 
Did you mean: 

auto complete using if_wd_select_options

Former Member
0 Kudos

Hi Experts,

I have a query regarding the field i_suggest_values parameter

in ADD_SELECTION_FIELD method of interface IF_WD_SELECT_OPTIONS.

Is it similar to the auto complete feature we have newly introduced

in wd?

If so how can we implement the auto complete feature using this

method. I am not able to find any documentations for this particular

parameter.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member213217
Participant
0 Kudos

Hi Tenzin,

Yes you are right this is something similar to the newly introduced auto complete feature in Web Dynpro. I just tried checking the same from my end and it works like a charm

Regards,

Uday

METHOD wddoinit .


  DATA: lt_range_table TYPE REF TO data,
        rt_range_table TYPE REF TO data,
        read_only      TYPE abap_bool,
        typename       TYPE string.
 
  DATA: lr_componentcontroller TYPE REF TO ig_componentcontroller,
        l_ref_cmp_usage        TYPE REF TO if_wd_component_usage.

* create the used component
  l_ref_cmp_usage = wd_this->wd_cpuse_select_options( ).
 
  IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
    l_ref_cmp_usage->create_component( ).
  ENDIF.

  wd_this->m_wd_select_options = wd_this->wd_cpifc_select_options( ).

* init the select screen
  wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
  wd_this->m_handler->set_global_options(
                              i_display_btn_cancel  = abap_false
                              i_display_btn_check   = abap_false
                              i_display_btn_reset   = abap_false
                              i_display_btn_execute = abap_false ).

* create a range table that consists of this new data element
  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'S_CARR_ID' ).

* add a new field to the selection
  wd_this->m_handler->add_selection_field( i_id = 'S_CARR_ID'
                                           i_suggest_values = abap_true
                                           it_result = lt_range_table i_read_only = read_only ).

ENDMETHOD.

Former Member
0 Kudos

Hi Uday,

I have already got that part.

After I added the follwing url parameter, it worked in my case.

WDACCESSIBILITY = off

WDALLOWVALUESUGGEST = X.

Thanks any ways.

Tenzin

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Tenzin,

You can try the below mentioned method, we use it this way.

data fld type  IF_WD_SELECT_OPTIONS=>T_SELECTION_SCREEN_ITEM.

data tbl type  IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.

fld-m_id = 'ID'.

fld-mt_range_table = LT_RANGE_TABLE.

fld-m_read_only  = abap_true.

insert fld into table tbl.

WD_THIS->M_HANDLER->ADD_SELECTION_FIELDs(tbl).

Hopefully, this will solve your probs.

BR

Pranav Agrawal

Former Member
0 Kudos

Hi Pranav,

I am using the add_selection_field method as mentioned earlier.

of the interface IF_WD_SELECT_OPTIONS.

It doesn't have a importing parameter of type IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM

as you have mentioned earlier.

however I see a parameter I_SUGGEST_VALUES, even though i set it to true, I am not able to get the auto fill on the ui.

Thanks

Tenzin

former_member213217
Participant
0 Kudos

Hi Tenzin,

For the auto fill to work the field would need to have a search help to be attached to it. When the user starts to key in a value into the input field the system does in the background pass in the value to the importing parameter of the search help & show the EXPORTING values of the search help as possible suggestions for the user.

I guess in your case there is no search help available at data element level for the field which you are trying to add using add_selection_field( ). So you would have to explicitly link one to the field. This you can do by using the 2 parameters I_VALUE_HELP_TYPE & I_VALUE_HELP_ID of the same method. You can pass in IF_WD_VALUE_HELP_HANDLER=>CO_VH_TYPE_BACKEND to I_VALUE_HELP_TYPE for indicating that you want to attach a dictionary search help to the field and then can pass in the actual search help name to the other parameter I_VALUE_HELP_ID.

Regards,

Uday