on 02-20-2012 1:31 PM
Hi,
I need to create a search help for my web dynpro application.I need to write the select queries in my search help exit based on some input fields (date fields) in the screen.My doubt is how can I access my screen fields in the search help.
Thanks and Regards,
Rohini
Hi Rohani ,
I think the use of OVS component can meet your ur requirement.
You will get a event handler where you can some some phase_indicator which are usually run in various action while using the search help. You can code there according to our requirement.
The following link can be helpful for using ovs component.
OVS : [http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9502%3Fpage%3Dlast]
regards,
Monishankar Chatterjee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Monishankar,
Thanks for your reply.My requirement is as below.
I have a datefield as an input fields and employee as my search help field in the screen 1.
From screen 1 ,if i click on the employee search help,it should filter the employees based on the date field.
My query is how can i access my datefield in the serach help for writing the selection query.
Thanks and Regards,
Rohini
Hi Rohani,
You need to use OVS to filter your search help depending on the input field value.
To do it follow the steps:
1) Reuse WDR_OVS in your component.
2)For the attribute which needs search help make the property of search help as OVS.
3)Create a event handler in your view for the OVS .(For F4 help on the field).
4)Inside this method read the value of your date field and You will have different Phases in the
OVS , in the phase where you display search help values use your date field value and filter the
search help values.
For details on how to use OVS , Follow the link
link:http://www.saptechnical.com/Tutorials/WebDynproABAP/OVS/page1.htm
Hi Rohani,
I think this can be achieved by using OVS component.
Declare the component usage for OVS in the properties tab of view. Your fields ( date & employee ) must be in a context node ,
there in the employee attribute main search help as ovs with, maintain the same component name in ovs component use attribute.
Follow sample code like below and made changes accordingly:-
types:
begin of lty_stru_input,
date type string,
end of lty_stru_input.
types:
begin of lty_stru_list,
DATE type string,
employee type string,
end of lty_stru_list.
data: ls_search_input type lty_stru_input,
lt_select_list type standard table of lty_stru_list,
ls_select_list TYPE lty_stru_list,
ls_text type wdr_name_value,
lt_label_texts type wdr_name_value_list,
lt_column_texts type wdr_name_value_list,
lv_window_title type string,
lv_group_header type string,
lv_table_header type string.
field-symbols: <ls_query_params> type lty_stru_input,
<ls_selection> type lty_stru_list.
case ovs_callback_object->phase_indicator.
when if_wd_ovs=>co_phase_0. "configuration phase, may be omitted
ls_text-name = `date`. "must match a field name of search
ls_text-value = `Date`. "wd_assist->get_text( `001` ).
insert ls_text into table lt_label_texts.
ls_text-name = `DATE`. "must match a field in list structure
ls_text-value = `Date`. "wd_assist->get_text( `002` ).
insert ls_text into table lt_column_texts.
ls_text-name = `employee`. "must match a field in list structure
ls_text-value = `Employee`. "wd_assist->get_text( `002` ).
insert ls_text into table lt_column_texts.
ovs_callback_object->set_configuration(
label_texts = lt_label_texts
column_texts = lt_column_texts
group_header = 'Details' "lv_group_header'
window_title = lv_window_title
table_header = lv_table_header
col_count = 2
row_count = 20 ).
when if_wd_ovs=>co_phase_1. "set search structure and defaults
ovs_callback_object->context_element->get_static_attributes(
importing static_attributes = ls_search_input ).
* pass the values to the OVS component
ovs_callback_object->set_input_structure(
input = ls_search_input ).
when if_wd_ovs=>co_phase_2.
if ovs_callback_object->query_parameters is not bound.
******** TODO exception handling
endif.
assign ovs_callback_object->query_parameters->*
to <ls_query_params>.
if not <ls_query_params> is assigned.
******** TODO exception handling
endif.
*( you will get the value of the date here, now keep your query to search employee based on that and fill those in the
lt_select_list table for display as a output)*
ovs_callback_object->set_output_table( output = lt_select_list ).
when if_wd_ovs=>co_phase_3.
* apply result
if ovs_callback_object->selection is not bound.
******** TODO exception handling
endif.
assign ovs_callback_object->selection->* to <ls_selection>.
if <ls_selection> is assigned.
ovs_callback_object->context_element->set_attribute(
name = `employee`
value = <ls_selection>-employee ).
* or
* ovs_callback_object->context_element->set_static_attributes(
* static_attributes = <ls_selection> ).
endif.
endcase.
endmethod.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.