0% found this document useful (0 votes)
373 views15 pages

This Document Helps You To Create OVS Help For Multiple Inputs in Select

This document provides steps to create OVS help for multiple input fields in a SELECT-OPTIONS component in ABAP. It describes how to create a WD component with a view and window, add SELECT_OPTIONS and OVS components, embed the selection screen view, instantiate and initialize the SELECT_OPTIONS controller, create range tables for input fields, add input fields, and write event handler methods to retrieve and return OVS results for each input field.

Uploaded by

Ace Kay
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
373 views15 pages

This Document Helps You To Create OVS Help For Multiple Inputs in Select

This document provides steps to create OVS help for multiple input fields in a SELECT-OPTIONS component in ABAP. It describes how to create a WD component with a view and window, add SELECT_OPTIONS and OVS components, embed the selection screen view, instantiate and initialize the SELECT_OPTIONS controller, create range tables for input fields, add input fields, and write event handler methods to retrieve and return OVS results for each input field.

Uploaded by

Ace Kay
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

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.

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

Step 4 : Select OVS and SELECT_OPTIONS Component.

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

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

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

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

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

Step 10 : Select Method Name-> INIT_SELECTION_SCREEN.

Code in WDDOINT Method after Method call.

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

Select Method->SET_GLOBAL_OPTIONS.

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.

Again go to pattern->Select CREATE_RANGE_TABLE Method.

Replace ME object with Interface Controller reference lv_r_helper_class . And add code like below.

Create another range table for KUNNR.

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 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 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.

"OVS Help

"OVS Help

Step 12 : Under this method write code like below.

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.

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.

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 ls_select_list fieldname field-symbols: type standard table of lty_stru_list, type lty_stru_list, TYPE string. type lty_stru_list, TYPE lty_stru_list, TYPE STANDARD TABLE, TYPE table, TYPE data.

<ls_selection> <lt_ovs_result> <lt_sel_opt_result> <fs_vbeln> <field>

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 :

Topics: Web Dynpro

You might also like