Skip to Content

This Document helps you to create OVS Help for multiple inputs in Select-Options.

Step 1 : Create WD Component with view and window.

Step 2 : Go to component, under used components use WDR_SELECT_OPTIONS and WDR_OVS as Components with SELECT_OPTIONS and OVS as Component use, as like below screenshot.

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

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

Step 3 : Go to view->properties tab->click on create controller usage.

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

Step 4 : Select OVS and SELECT_OPTIONS Component. 

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

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

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

 

Step 5 : Go to view layout->create view container ui element.

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

Step 6 : Go to Window->Right click on created View container, here VC-> Click Embed View.

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

Step 7 : F4 on view to be Embeded->Select WND_SELECTION_SCREEN View.

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

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

Step  8 :  Go to  view WDDOINIT method-> Go to code wizard-> Select Instantiate used component->Click F4 Select Select_options.

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

Step 9 : Go to code wizard->Select  Method call in Used Controller->Select Component WDR_SELECT_OPTIONS.

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

Step 10 : Select Method Name-> INIT_SELECTION_SCREEN.

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

Code in WDDOINT Method after Method call.

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

Click on Pattern->Select ABAP Objects Pattern->Give Interface name IF_WD_SELECT_OPTIONS.

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

Select Method->SET_GLOBAL_OPTIONS.

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

Replace ME object with Interface Controller reference lv_r_helper_class .

Change all Exporting Parameters to ABAP_FALSE. If you want any button required on selection screen make it abap_true.

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

Again go to pattern->Select CREATE_RANGE_TABLE Method.

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

Replace ME object with Interface Controller reference lv_r_helper_class .

And add code like below.

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

Create  another range table for KUNNR.

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

Complete Sample Code in WDDOINT Method.

method WDDOINIT .
*– Instantiate the used component –*

  data lo_cmp_usage type ref to if_wd_component_usage.

  lo_cmp_usage =   wd_this->wd_cpuse_select_options( ).
  if lo_cmp_usage->has_active_component( ) is initial.
    lo_cmp_usage->create_component( ).
 
endif.

  DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_WDR_SELECT_OPTIONS .
  lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_select_options( ).

  DATA lv_r_helper_class TYPE ref to if_wd_select_options.
  lv_r_helper_class = lo_interfacecontroller->init_selection_screen( ).

  CALL METHOD lv_r_helper_class->SET_GLOBAL_OPTIONS
   
EXPORTING
      I_DISPLAY_BTN_CANCEL  = ABAP_FALSE
      I_DISPLAY_BTN_CHECK   = ABAP_FALSE
      I_DISPLAY_BTN_RESET   = ABAP_FALSE
      I_DISPLAY_BTN_EXECUTE = ABAP_FALSE.

  DATA : rt_vbeln TYPE REF TO data.
 
DATA : rt_kunnr TYPE REF TO data.

  CALL METHOD lv_r_helper_class->CREATE_RANGE_TABLE
   
EXPORTING
      I_TYPENAME     =
‘VBELN’
    RECEIVING
      RT_RANGE_TABLE = rt_vbeln.
  lv_r_helper_class->add_selection_field(
    i_id              =
`VBELN`
    I_DESCRIPTION     =
‘Sales Document’
    i_value_help_type = if_wd_value_help_handler=>co_prefix_ovs
“OVS Help
    it_result         = rt_vbeln ).
 
FREE rt_vbeln.

  CALL METHOD lv_r_helper_class->CREATE_RANGE_TABLE
   
EXPORTING
      I_TYPENAME     =
‘KUNNR’
    RECEIVING
      RT_RANGE_TABLE = rt_kunnr.
  lv_r_helper_class->add_selection_field(
    i_id              =
`KUNNR`
    I_DESCRIPTION     =
‘Customer’
    i_value_help_type = if_wd_value_help_handler=>co_prefix_ovs
“OVS Help
    it_result         = rt_kunnr ).
 
FREE rt_kunnr.

ENDMETHOD.

Step 11 : Go to Methods->Create OVS Event Handler->Under Event click F4->Select ON_OVS Event for Select Options.

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

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

Step 12 : Under this method write code like below.

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

Sample code :

method OVS.
 
 
IF i_ovs_data-m_selection_field_id = ‘VBELN’.
    OVS_VBELN( i_ovs_data ).
 
ELSEIF i_ovs_data-m_selection_field_id = ‘KUNNR’.
    OVS_KUNNR( i_ovs_data ).
 
ENDIF.
endmethod.

Step 13 : Now we have to write code to get OVS for both VBELN and KUNNR.

Step 14 : Go to Methods tab-> create two methods OVS_VBELN and OVS_KUNNR.

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

Step 15 : Go to OVS_VBELN Method->Create Importing Parameter

I_OVS_DATA  TYPE  IF_WD_SELECT_OPTIONS=>T_OVS_DATA.  And Write code for OVS_VBELN.

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

Sample Code OVS_VBELN.

method OVS_VBELN .

  types:
   
begin of lty_stru_list,
      VBELN
type VBELN,
   
end of lty_stru_list.

  data: lt_select_list   type standard table of lty_stru_list,
        ls_select_list  
type lty_stru_list,
        fieldname       
TYPE string.

  field-symbols:  <ls_selection>     type lty_stru_list,
                 <lt_ovs_result>    
TYPE lty_stru_list,
                 <lt_sel_opt_result>
TYPE STANDARD TABLE,
                 <fs_vbeln>         
TYPE table,
                 <field>            
TYPE data.

  case i_ovs_data-m_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.

      SELECT VBELN FROM VBAK
            
INTO TABLE lt_select_list.

      i_ovs_data-m_ovs_callback_object->set_output_table( output = lt_select_list ).

    WHEN if_wd_ovs=>co_phase_3.
     
ASSIGN i_ovs_data-m_ovs_callback_object->selection->* TO <lt_ovs_result>.
     
ASSIGN i_ovs_data-mt_selected_values->* TO <lt_sel_opt_result>.
      fieldname = i_ovs_data-m_selection_field_id.
     
ASSIGN COMPONENT fieldname OF STRUCTURE <lt_ovs_result> TO <field>.
     
INSERT <field> INTO TABLE <lt_sel_opt_result>.
 
endcase.
endmethod.

Step 16 : Repeate step 15 for OVS_KUNNR.  Add Importing Parameter, in code declare kunnr field types and fetch kunnr in select query.

Output :

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

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply