cancel
Showing results for 
Search instead for 
Did you mean: 

More than 1 OVS in 1 View

Former Member
0 Kudos

I used OVS for creating Search Help,

I got the problem when using more than 1 OVS in 1 view,

I've been creating 2 Component Use : OVS and OVS_MATNR , then creating Method ON_OVS to handle OVS and Method ON_OVS_MATNR to handle OVS_MATNR.

the problem is when I running input field for OVS_MATNR why method ON_OVS is always execute not method ON_OVS_MATNR that should be execute?what a linkage between OVS input field and OVS method,I think only in co_phase1 anything else?

Thanks you,for your help,

Wirawan

Edited by: Dona Wirawan on Aug 12, 2010 5:22 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

I've trying to debugging and found some clue here


method IF_WDR_VIEW_DELEGATE~wd_invoke_event_handler.
*===================================================
" generic event dispatcher for use via framework ifc

  data: wdEvent like Event.
  wdEvent = Event.

* check if wd_do_exit has been called already
  if ( abap_True eq f_Sys64738 ).
    raise exception type Cx_Wd_Bad_State
      exporting
        Textid = Cx_Wd_Bad_State=>Usage_After_Do_Exit.
  endif.
  case *Handler_Name*.
    when `HANDLEENTER_OVS`.
      f_Appl_Class->handleenter_ovs( WdEvent ).

    when `ON_OVS`.
      Me->on_ovs( WdEvent ).

    when `ON_OVS_MATNR`.
      Me->on_ovs_matnr( WdEvent ).

    when others.
      raise exception type Cx_Wd_Bad_Args
        exporting
          Parameter = `HANDLER_NAME`
          Argument =  Handler_Name.
  endcase.
endmethod.

Why my Handler_Name is alwasy set to 'ON_OVS', any step that I missing when creating OVS?

Thanks for your help

Former Member
0 Kudos

HI Dona Wirawan ,

1 . Make sure you reuse WDA_OVS only once in the used component tabs .

2 . create your ovs events in views [http://i34.tinypic.com/j0vad2.jpg|http://i34.tinypic.com/j0vad2.jpg]

3. for handling the correct event .

reffere the piece of code .

method ovs_emp     "1st OVS
  data  : ls_parameter TYPE  wdr_event_parameter_list,
             ls_ovs TYPE wdr_event_parameter,
             lv_value TYPE string .
     ls_parameter = wdevent->parameters .
  LOOP AT  ls_parameter INTO ls_ovs WHERE  name = 'OVS_CONTEXT_ATTRIBUTE'.

    CALL METHOD wdevent->get_string
      EXPORTING
        name  = 'OVS_CONTEXT_ATTRIBUTE'
      RECEIVING
        value = lv_value.   " you will get the attribute name of the ovs Help Field 

       IF lv_value = 'EMP_NO'.
              lv_flag = 'X'.
        ENDIF.
  ENDLOOP.
IF lv_flag EQ 'X'.

" Perform the OVS coding here

endif . 

endmethod .

method ovs_req_type.  "2nd OVS
 data  : ls_parameter TYPE  wdr_event_parameter_list,
             ls_ovs TYPE wdr_event_parameter,
             lv_value TYPE string .
     ls_parameter = wdevent->parameters .
  LOOP AT  ls_parameter INTO ls_ovs WHERE  name = 'OVS_CONTEXT_ATTRIBUTE'.

    CALL METHOD wdevent->get_string
      EXPORTING
        name  = 'OVS_CONTEXT_ATTRIBUTE'
      RECEIVING
        value = lv_value.   " you will get the attribute name of the ovs Help Field 

       IF lv_value = 'REQ_TYPE'.
              lv_flag = 'Y'.
        ENDIF.
  ENDLOOP.
IF lv_flag EQ 'Y'.

 " Perform the OVS coding here

endif .
endmethod .

its worked for me .. Hope for you too ..

Regards

Chinnaiya P

Edited by: chinnaiya pandiyan on Aug 12, 2010 2:56 PM

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Chinnaiya,

I reuse WDA_OVS only once in the used component tabs then its worked for me too , thanks Chinnaiya P

Regards

Dona Wirawan

Former Member
0 Kudos

Hi Tulasi,

Can you tell me,step to binding input field with event?

*current condition : I binding property value of input field to context

Hi chinnaiya,

I've been try your solution then i found in debugger both 1st OVS and 2nd OVS_MATNR always enter to method ON_OVS,

and if CHECK lv_field EQ 'MATNR'. did'nt pass that will be short dump because can't set output table.

I want when i clicking input field OVS 1 then enter on_ovs method and when clicking input field OVS 2 then enter on_ovs_matnr method. let me know when i miss something...

thanks guys for your help

Former Member
0 Kudos

Hi Dona Wirawan ,

To avoid that usage of using the OVS component Twice & error by checking the attribute before the OVS case executed

use the below sample code in the ovs Method

method OVS_help 
 data : lv_field         TYPE string .
 get field on which ovs is called
  lv_field = wdevent->get_string( 'OVS_CONTEXT_ATTRIBUTE' ).
* check if it is payno
  CHECK lv_field EQ 'MGR_PAY_NO'. "Attribute name of the search help Field 
* now ovs case

CASE ovs_callback_object->phase_indicator .

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

endcase .

check the same conditions before all the OVS in yourcomponent

Regards

Chinnaiya P

endmethod .

Edited by: chinnaiya pandiyan on Aug 12, 2010 12:03 PM

Former Member
0 Kudos

Hi Donna

Its working For me by putting two OVS Std Components two different Input Fields

Suppose MATNR attribute with input help OVS and component Usage OVS1

take another attribute PERNR in Same view with input help OVS and component Usage OVS2.

OVS1 and OVS2 are two USED Components of our Component.

Create two event handlers one FOR ON_MATNR and bind the event (OVS) of OVS1 and other for ON_PERNR and bind the event(OVS) of OVS2.

Implement Your business Logic in respective events

let me know if you have any doubts..

Thanks

Tulasi Palnati