cancel
Showing results for 
Search instead for 
Did you mean: 

ovs search help(custom search help)

Former Member
0 Kudos

Hi ,

i have some company code which i am maintaning in the backend in the ztable and there are some PO number related to it in that ztable .

I wanted to define the custom search help , on the basis of Company code i can enter the PO number related to that company code .

please give me the code for this , its really uregent .

pls don't give me any link give me the code for this

Thanks & Regards

Nitin

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

yes it is resolved ...actually i was out of stattion for one week so i was not able to reply....

warm regards

nitin

chengalarayulu
Active Contributor
0 Kudos

change the thread status

Former Member
0 Kudos

Hi,

Please follow this link.

http://files.cnblogs.com/sodmecai/OVS.pdf

Regards,

venkat.

chengalarayulu
Active Contributor
0 Kudos

is it resolved?

chengalarayulu
Active Contributor
0 Kudos

WD Consultant,

the below snippet may help you.

as per my understanding, you have inputfield for Company Code. first company code you are selecting, and then you are selecting PO number right?

PO should be populated based on that company code right?

for the above said scenerio, below are the steps.

1. on OVS event method, just populate(perform your select query operations initially, means Phase-2 itself.

Convert & Write the below code in to your format on OVS EventHandler method.

   * 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_list,
*   add fields for the selection list here
          company TYPE short_d,
          ponum TYPE stext,
END OF lty_stru_list.

  DATA: ls_search_input  TYPE lty_stru_input,
        lt_select_list   TYPE STANDARD TABLE OF lty_stru_list,
        ls_select_list   TYPE 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.

  DATA : lv_short TYPE string,
        lv_stext TYPE string.

  CASE ovs_callback_object->phase_indicator.

    WHEN if_wd_ovs=>co_phase_0. "configuration phase, may be omitted

      ls_text-name = `COMPANY`.
      ls_text-value = `Company`.
      INSERT ls_text INTO TABLE lt_column_texts.

      ls_text-name = `PONUM`.
      ls_text-value = `PO Number`.
      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 = 'Job Abbreviation'
                col_count    = 2
                row_count    = 10 ).

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

    WHEN if_wd_ovs=>co_phase_2.

1. Read the company code here
2. Write your select query with comparing condition of company code.
3. populate the values into lt_select_list.

Example:-
*      ls_select_list-short = 'One'.
*      APPEND ls_select_list TO lt_select_list.
*
*      ls_select_list-short = 'One'.
*      APPEND ls_select_list TO lt_select_list.

      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  = `PONUM`
                               value = <ls_selection>-ponum ).
      ENDIF.
  ENDCASE.

Gowtham
Contributor
0 Kudos

Hi Nitin,

Hope the following link will be helpful for you.

http://wiki.sdn.sap.com/wiki/display/Snippets/OVS+search+help

Regards,

Gowtham.A