cancel
Showing results for 
Search instead for 
Did you mean: 

How to manage multiple OVS helps

mathias_hagen
Explorer
0 Kudos

Hi,

Im struggeling with my OVS helps. I need to manage many of them in the same WD application.

Ive been following a standard guide and the first OVS i created worked perfectly.

I tried creating the second one in a different view, but I cant seem to get it to work. It dumps when performing a search with a "Type conflict with ASSIGN in program " error. When I look at the error-log I clearly see that it is trying to perform the search in my first OVS help.

So my first question: Can I use the same OVS component (WDR_OVS) for both views or do I need to set up multiple "Used components"?

Hoping for some tips and answers 😃

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi Mathias,

We can trigger OVS for multiple fields by reusing WDR_OVS only once in our component. If you create two different usages for two fields, performance problem will occur. Check the below code co handle OVS for different fields using single usage.

method ovs_emp_id     " OVS for emp Id 
  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.   "  lv_value will return the attribute name of OVS Help field
 
       IF lv_value = 'EMP_ID'. 
              lv_flag = 'X'.
        ENDIF.
  ENDLOOP.
IF lv_flag EQ 'X'.
 
" Perform your OVS coding for Employee ID here..
 
endif . 
 
endmethod .

method ovs_emp_name     " OVS for emp Name
  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.   "  lv_value will return the attribute name of OVS Help field
 
       IF lv_value = 'EMP_Name'. 
              lv_flag = 'X'.
        ENDIF.
  ENDLOOP.
IF lv_flag EQ 'X'.
 
" Perform your OVS coding for Employee Name here..
 
endif . 
 
endmethod .

Or instead of creating 2 separate methods , you can set flag X for employee ID, and flag Y for employee Name in single method itself and handle accordingly.

Hope this helps u.,

Revert back if you need some more clarifications.,

Thanks & regards,

Kiran.

Answers (1)

Answers (1)

Former Member
0 Kudos

You need to create multiple usage of component WDR_OVS and obviously with different use names for each F4 you want to implement using OVS.