cancel
Showing results for 
Search instead for 
Did you mean: 

Creating OVS for a field

Former Member
0 Kudos

Hi All ,

I am trying to add the OVS for a particular field in my web dynpro application and for this I have done the folllowing:

1. I added the component WDR_OVS to my component interface.

2. I then added the following to my component controller

OVS WDR_OVS System Component for OVS Input Help

OVS WDR_OVS INTERFACECONTROLLER Generic Input Help

3. I set the input help mode as 'Object Value Selector' and OVS Component usage as 'OVS' for the attribute 'Alternate_payee'.

4 . I then created a even handler type method ON_OVS in the main view and inserted the following code to it:

DATA: lifnr TYPE lfa1-lifnr,
        f4lfb1_z TYPE lfb1,
        filkd TYPE bseg-filkd,
        t_zemtab TYPE STANDARD TABLE OF izemtab,
        w_zemtab  LIKE LINE OF t_zemtab.
  DATA: lt_value_set TYPE TABLE OF wdr_context_attr_value,
            ls_value_set LIKE LINE OF lt_value_set.


  SELECT SINGLE * FROM  lfb1 INTO f4lfb1_z
                  WHERE lifnr = w_lifnr
                  AND   bukrs = '001'.

  CALL FUNCTION 'FI_VENDOR_ALTERN_PAYERS_READ'
    EXPORTING
      i_lifnr            = w_lifnr
      i_filkd            = filkd
      i_bukrs            = '001'
      i_lfb1_head_office = f4lfb1_z
    TABLES
      t_zemtab           = t_zemtab.

data w_alt_emp_string type string.
  LOOP AT t_zemtab INTO w_zemtab.
    concatenate w_zemtab-empfb ' ' w_zemtab-name1 ' ' w_zemtab-ORT01 ' ' w_zemtab-STRAS ' ' w_zemtab-PFACH into w_alt_emp_string RESPECTING BLANKS.
    ls_value_set-text = w_alt_emp_string.
    ls_value_set-value = w_alt_emp_string.
append ls_value_set to lt_value_set.
  ENDLOOP.

 DATA lo_nd_alt_payee_info TYPE REF TO if_wd_context_node_info.
 DATA lo_nd_alt_payee TYPE REF TO if_wd_context_node.

lo_nd_alt_payee = wd_context->get_child_node( name = wd_this->wdctx_alt_payee ).
lo_nd_alt_payee_info = lo_nd_alt_payee->get_node_info( ).

         lo_nd_alt_payee_info->set_attribute_value_set(
            name =  `ALERNATE_PAYEE`
            value_set = lt_value_set ).

Now when I run the application and do F4 on the desired field I am getting the short dump as ''OVS: Methode SET_OUTPUT_TABLE Cannot Be Called "

Can you please tell me what am I missing here?

Edited by: rajatg on Jul 27, 2011 9:42 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Raja,

Problem in your OVS coding, casn you please paste that code??

Cheers,

Kris.

Former Member
0 Kudos

Hi Kris,

This is all tht I have coded... may be I am missing something. I haven't done the OVS before.

saravanan_narayanan
Active Contributor
0 Kudos

Hello,

WDR_OVS->OVS event follows a phase model approach. Once you create a event handled method for the OVS, the code template will be auto generated and it will look like this


* 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
      field1 type string,
    end of lty_stru_input.
  types:
    begin of lty_stru_list,
*   add fields for the selection list here
      column1 type string,
    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 = `FIELD1`.  "must match a field name of search
      ls_text-value = `MYTEXT`. "wd_assist->get_text( `001` ).
      insert ls_text into table lt_label_texts.

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

*      lv_window_title = wd_assist->get_text( `003` ).
*      lv_group_header = wd_assist->get_text( `004` ).
*      lv_table_header = wd_assist->get_text( `005` ).

      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
*   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 = ???

      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  = `COLUMN1`
*                               value = <ls_selection>-column1 ).
*      or
*        ovs_callback_object->context_element->set_static_attributes(
*                               static_attributes = <ls_selection> ).

      endif.
  endcase.

you need to adapt this code to pass the required structure and data.

BR, Saravanan