cancel
Showing results for 
Search instead for 
Did you mean: 

issue is OVS help

Former Member
0 Kudos

Dear friends

i entered in ovs help  "gmr"   in search criteria and then i pressed search ,

i dint get any thing in output

but i should get

"GMR Construction Pvt Ltd"

below is my select statement in business logic

SELECT lifnr name1 FROM lfa1 INTO CORRESPONDING

         FIELDS OF TABLE lt_lfa1

         WHERE lifnr LIKE lv_lifnr AND

               name1 LIKE lv_name1.



could any one let me know what is missing in my select statement


Thanks

Srini

Accepted Solutions (0)

Answers (2)

Answers (2)

rajeshkothamasu
Active Participant
0 Kudos

As kathik said add GMR* and write the code as per below code


when if_wd_ovs=>co_phase_1.  "set search structure and defaults*   In this phase you can set the structure and default values of the search structure. If this phase is omitted, the search fields will not be displayed, but the selection table is displayed directly.

*   Read values of the original context (not necessary, but you
*   may set these as the defaults). A reference to the context
*   element is available in the callback object.
      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 phase 1 is implemented, use the field input for the
*   selection of the table.
*   If phase 1 is omitted, use values from your own context.
      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.
*     call business logic for a table of possible values
*     lt_select_list = ???
      lv_short = <ls_query_params>-job_id.
      REPLACE ALL OCCURRENCES OF '*' IN lv_short WITH '%' .
      IF lv_short NE ' ' AND lv_stext NE ' '.
        SELECT short stext  FROM hrp1000 INTO TABLE lt_select_list
        WHERE plvar = '01' AND otype = 'C' AND langu = 'EN' AND
            endda GE sy-datum AND ( short LIKE lv_short )
            ORDER BY short ASCENDING.
      ELSEIF lv_short EQ ' ' AND lv_stext NE ' '.
        SELECT short stext FROM hrp1000 INTO TABLE lt_select_list
        WHERE plvar = '01' AND otype = 'C' AND langu = 'EN' AND
            endda GE sy-datum 
            ORDER BY short ASCENDING.
      ELSEIF lv_short NE ' ' .
        SELECT short stext FROM hrp1000 INTO TABLE lt_select_list
        WHERE plvar = '01' AND otype = 'C' AND langu = 'EN' AND
            endda GE sy-datum AND short LIKE lv_short
            ORDER BY short ASCENDING.
      ENDIF.
      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  = `JOB_ID`
                               value = <ls_selection>-short ).
former_member184578
Active Contributor
0 Kudos

Hi,

you need to add * in the OVS help input field and then replace those * with % and build a select query.

Write the below code in OVS phase2


    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 lifnr name1 FROM lfa1 INTO CORRESPONDING

         FIELDS OF TABLE lt_lfa1

         WHERE name1 LIKE <ls_query_params>-ename.

      ovs_callback_object->set_output_table( output = lt_select_list ).

If you don't want to enter * in the input, then concatenate % at the start and end of the string value

hope this helps,

Regards,

Kiran