Skip to Content
Author's profile photo Krishna Reddy B

How to use OVS Search Help For Multiple Inputs

This Document helps you to create OVS Help for multiple inputs. 

Create WebDynpro Component with initial view and window.

Go to Component, under used component use WDR_OVS under componet with OVS Component use.

/wp-content/uploads/2013/05/step1_216299.png

Goto view context create 2 attributes, VBELN and KUNNR.

/wp-content/uploads/2013/05/step2_215814.png

Go to View Layout and create input fields for VBELN and KUNNR.

Go to Properties->Select input help mode to OVS and select OVS Component usage. Do the same for all attributes.

/wp-content/uploads/2013/05/step3_215815.png

Go to Methods tab->Create OV_OVS Enent handler, by selecting Event as OVS.( What you created in First Step ).

/wp-content/uploads/2013/05/step4_215816.png

Under ON_OVS method write sample code like below.

Sample Code :

method ON_OVS .

  types:
   
begin of lty_stru_input,
      vbeln
type vbeln,
   
end of lty_stru_input.
 
types:
   
begin of lty_stru_list,
      vbeln
type vbeln,
   
end of lty_stru_list.

  types:
   
begin of lty_stru_input1,
      kunnr
type kunnr,
   
end of lty_stru_input1.
 
types:
   
begin of lty_stru_list1,
      kunnr
type kunnr,
   
end of lty_stru_list1.

  data: ls_search_input  type lty_stru_input,
        lt_select_list  
type standard table of lty_stru_list,
        ls_search_input1
type lty_stru_input1,
        lt_select_list1 
type standard table of lty_stru_list1.

  FIELD-SYMBOLS : <ls_selection>  type lty_stru_list,
                  <ls_selection1>
type lty_stru_list1.

  CASE ovs_callback_object->phase_indicator.

    WHEN if_wd_ovs=>co_phase_0.
   
WHEN if_wd_ovs=>co_phase_1.
   
WHEN if_wd_ovs=>co_phase_2.

      IF ovs_callback_object->context_attribute CS ‘VBELN’.
       
SELECT vbeln
              
FROM vbak INTO TABLE lt_select_list
              
WHERE ernam = sy-uname.
        ovs_callback_object->set_output_table(
output = lt_select_list ).

      ELSEIF ovs_callback_object->context_attribute CS ‘KUNNR’.
       
SELECT kunnr
              
FROM kna1 INTO TABLE lt_select_list1
              
WHERE ernam = sy-uname.
        ovs_callback_object->set_output_table(
output = lt_select_list1 ).
     
ENDIF.

    WHEN if_wd_ovs=>co_phase_3.

      IF ovs_callback_object->context_attribute CS ‘VBELN’.
       
ASSIGN ovs_callback_object->selection->* TO <ls_selection>.
       
IF <ls_selection> IS ASSIGNED.
          ovs_callback_object->context_element->set_attribute(
                                 name  =
`VBELN`
                                
value = <ls_selection>-vbeln ).
       
ENDIF.
     
ENDIF.
     
IF ovs_callback_object->context_attribute CS ‘KUNNR’.
       
ASSIGN ovs_callback_object->selection->* TO <ls_selection1>.
       
IF <ls_selection1> IS ASSIGNED.
          ovs_callback_object->context_element->set_attribute(
                                 name  =
`KUNNR`
                                
value = <ls_selection1>-kunnr ).
       
ENDIF.
     
ENDIF.
 
ENDCASE.


endmethod.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.