步骤1:在component里引用OVS component
DEPT_OVS WDR_OVS System Component for OVS Input Help
OVS WDR_OVS System Component for OVS Input Help
步骤2:在context 里的对应字段比如Z_CENTER_CD 的属性input help mode改为 object value selector 在OVS component usage里选择你刚才添加的OVS 名字
步骤3:
在对应的view里引用刚才的OVS component
步骤4:增加OVS事件EVENT hander
步骤5:修改自动生成的代码
types:
begin of lty_stru_input,
* add fields for the display of your search input here
z_dept_cd type string ,
z_dept_nm type string ,
* field1 type string,
end of lty_stru_input.
types:
begin of lty_stru_list,
* add fields for the selection list here
z_dept_cd type zcdm_v_org-z_dept_cd ,
z_dept_nm type zcdm_v_org-z_dept_nm ,
* column1 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_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: type lty_stru_input,
type lty_stru_list.
case ovs_callback_object->phase_indicator.
when if_wd_ovs=>co_phase_0. "configuration phase, may be omitted
* in this phase you have the possibility to define the texts,
* if you do not want to use the defaults (DDIC-texts)
* ls_text-name = `Z_DEPT_CD`. "must match a field name of search
* ls_text-value = `部门代码`. "wd_assist->get_text( `001` ).
* insert ls_text into table lt_label_texts.
*
* ls_text-name = `COLUMN1`. "must match a field in list structure
* ls_text-value = `MYTEXT2`. "wd_assist->get_text( `002` ).
* insert ls_text into table lt_column_texts.
* lv_window_title = wd_assist->get_text( `003` ).
* lv_group_header = wd_assist->get_text( `004` ).
* lv_table_header = wd_assist->get_text( `005` ).
ovs_callback_object->set_configuration(
label_texts = lt_label_texts
column_texts = lt_column_texts
group_header = lv_group_header
window_title = lv_window_title
table_header = lv_table_header
col_count = 2
row_count = 8 ).
when if_wd_ovs=>co_phase_1. "set search structure and defaults
* In this phase you can set the structure and default values
* of the search structure. If this phase is omitted, the search
* fields will not be displayed, but the selection table is
* displayed directly.
* Read values of the original context (not necessary, but you
* may set these as the defaults). A reference to the context
* element is available in the callback object.
* 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 phase 1 is implemented, use the field input for the
* selection of the table.
* If phase 1 is omitted, use values from your own context.
*
* if ovs_callback_object->query_parameters is not bound.
********* TODO exception handling
* endif.
* assign ovs_callback_object->query_parameters->*
* to .
* if not is assigned.
********* TODO exception handling
* endif.
select z_dept_cd z_dept_nm
into table lt_select_list
from zcdm_v_org
where z_dept_cd like '____000' .
* call business logic for a table of possible values
* lt_select_list = ???
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 .
if is assigned.
ovs_callback_object->context_element->set_attribute(
name = `Z_CENTER_CD`
value = -z_dept_cd ).
* or
* ovs_callback_object->context_element->set_static_attributes(
* static_attributes = ).
endif.
endcase.
阅读(3253) | 评论(0) | 转发(0) |