cancel
Showing results for 
Search instead for 
Did you mean: 

Letters * like search in OVS?

Former Member
0 Kudos

Dear All,

As per requirement... For input field i have OVS. now requirement is... user want to search based on input credentials.

For example... if user give H* and try to search i want to display all values staring with H...

If user give HY* i want to display all starts HY...

Is it possible in OVs?? if yes how can i achieve this..

Thanks,

Venkys.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184578
Active Contributor
0 Kudos

Hi,

Yes we can do this.,

check the below code.,

method ONOVS .
*By: Kiran Kumar Reddy
* declare data structures for the fields to be displayed and
* for the table columns of the selection list, if necessary
  types:
    begin of lty_stru_input,
*   add fields for the display of your search input here
      ename type emnam,
    end of lty_stru_input.
  types:
    begin of lty_stru_list,
*   add fields for the selection list here
      ename type emnam,
    end of lty_stru_list.

  data: ls_search_input  type lty_stru_input,
        lt_select_list   type standard table of lty_stru_list,
        ls_text          type wdr_name_value,
        lt_label_texts   type wdr_name_value_list,
        lt_column_texts  type wdr_name_value_list,
        lv_window_title  type string,
        lv_group_header  type string,
        lv_table_header  type string.

  field-symbols: <ls_query_params> type lty_stru_input,
                 <ls_selection>    type lty_stru_list.

  case ovs_callback_object->phase_indicator.

    when if_wd_ovs=>co_phase_0.  "configuration phase, may be omitted
*   in this phase you have the possibility to define the texts,
*   if you do not want to use the defaults (DDIC-texts)

      ls_text-name = `ENAME`.  "must match a field name of search
      ls_text-value = `Enter Name`. "wd_assist->get_text( `001` ).
      insert ls_text into table lt_label_texts.

      ls_text-name = `ENAME`.  "must match a field in list structure
      ls_text-value = `Enter Name`. "wd_assist->get_text( `002` ).
      insert ls_text into table lt_column_texts.

      ovs_callback_object->set_configuration(
                label_texts  = lt_label_texts
                column_texts = lt_column_texts
                group_header = lv_group_header
                window_title = lv_window_title
                table_header = lv_table_header
                col_count    = 2
                row_count    = 20 ).


    when if_wd_ovs=>co_phase_1.  "set search structure and defaults

      ovs_callback_object->context_element->get_static_attributes(
          importing static_attributes = ls_search_input ).
*     pass the values to the OVS component
      ovs_callback_object->set_input_structure(
          input = ls_search_input ).


    when if_wd_ovs=>co_phase_2.

      if ovs_callback_object->query_parameters is not bound.
******** TODO exception handling
      endif.
      assign ovs_callback_object->query_parameters->*
                              to <ls_query_params>.
      if not <ls_query_params> is assigned.
******** TODO exception handling
      endif.


 "   Here <ls_query_params> contains the entered input value. 
 "   U need to replace * with % while fetching from DB

     replace all occurrences of '*' in <ls_query_params>-ename with '%'.
     select ename from pa0001 into table lt_select_list where ename like <ls_query_params>-ename.

      ovs_callback_object->set_output_table( output = lt_select_list ).


    when if_wd_ovs=>co_phase_3.
*   apply result

      if ovs_callback_object->selection is not bound.
******** TODO exception handling
      endif.

      assign ovs_callback_object->selection->* to <ls_selection>.
      if <ls_selection> is assigned.
        ovs_callback_object->context_element->set_attribute(
                               name  = `NAME`
                               value = <ls_selection>-ename ).

      endif.
  endcase.

endmethod.

hope this helps u.,

Thanks & Regards,

Kiran.

Former Member
0 Kudos

If there is a search help attached, then it will come...using OVS..have you checked when you run the F4 and screen is displayed wether the list is dsplaying or not...i'm try to memorize them as I have used OVS in my developments...

Former Member
0 Kudos

Hi Lekha,

Thanks for your quick reply..

Values are coming.. i want to search like what i mentioned above.

In OVS help we get defalut one button after clicking F4,.. if i give any input like HY* i am getting values it is working fine.

But user asking in input itselft they enter HY* and in they press f4 they want list of values. it is not working.

Any suggestions please.. I want this in table input field.

I am not getting: Search help attached... means at dictionary level???

Thanks,

Venkys.

Former Member
0 Kudos

is that field a part of the table...Ok if it is an input field and HY* and upon F4 click..those things should be shown in OVS as a result...in this case..have you checked any wdr_test_ovs...give for that filed wildcard search and click on F4 the result list willbe shown automatically or not...I guess..it will be shown ....