请问一个webdynpro问题
在webdynpro里我用selectoptions和ovs作一个搜索页面,但是不知道怎么做,请高手指点怎么做,不要发英文的,谢谢...
在webdynpro里我用select options和ovs作一个搜索页面,但是不知道怎么做,请高手指点怎么做,不要发英文的,谢谢
展开
展开全部
在先初始化select option。写一个method,在WDDOINIT方法里面调用。
method INIT_OPTION .
********************************SELECT OPTION初始化**********************************
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(
).
*** 先移除所有选择屏幕
LV_R_HELPER_CLASS->REMOVE_ALL_SEL_SCREEN_ITEMS( ).
DATA:
LT_RANGE_TABLE TYPE REF TO DATA,
RT_RANGE_TABLE TYPE REF TO DATA,
LV_ABAP_BOOL TYPE BOOLEAN VALUE ABAP_FALSE,
READ_ONLY TYPE ABAP_BOOL.
* create a range table that consists of this new data element
RT_RANGE_TABLE =
LV_R_HELPER_CLASS->CREATE_RANGE_TABLE( I_TYPENAME = 'KUNNR' ).
* add a new field to the selection
LV_R_HELPER_CLASS->ADD_SELECTION_FIELD(
I_ID = 'KUNNR'
I_DESCRIPTION = '客户'
I_OBLIGATORY = LV_ABAP_BOOL
IT_RESULT = RT_RANGE_TABLE
* I_IS_NULLABLE = LV_ABAP_BOOL
I_VALUE_HELP_TYPE = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_OVS
I_VALUE_HELP_ID = 'SHLP_KUNNR' "--------select option界面 客户搜索帮助事件名称
).
* create a range table that consists of this new data element
RT_RANGE_TABLE =
LV_R_HELPER_CLASS->CREATE_RANGE_TABLE( I_TYPENAME = 'ANDATUM' ).
* add a new field to the selection
LV_R_HELPER_CLASS->ADD_SELECTION_FIELD(
I_ID = 'ANDATUM'
I_DESCRIPTION = '创建日期'
I_OBLIGATORY = LV_ABAP_BOOL
IT_RESULT = RT_RANGE_TABLE
* I_IS_NULLABLE = LV_ABAP_BOOL
).
* create a range table that consists of this new data element
RT_RANGE_TABLE =
LV_R_HELPER_CLASS->CREATE_RANGE_TABLE( I_TYPENAME = 'ZSTATU1' ).
* add a new field to the selection
LV_R_HELPER_CLASS->ADD_SELECTION_FIELD(
I_ID = 'ZSTATU1'
I_OBLIGATORY = LV_ABAP_BOOL
IT_RESULT = RT_RANGE_TABLE
* I_IS_NULLABLE = LV_ABAP_BOOL
).
* create a range table that consists of this new data element
RT_RANGE_TABLE =
LV_R_HELPER_CLASS->CREATE_RANGE_TABLE( I_TYPENAME = 'ZE_TITLE' ).
* init the select screen
LV_R_HELPER_CLASS->SET_GLOBAL_OPTIONS(
I_DISPLAY_BTN_CANCEL = ABAP_FALSE
I_DISPLAY_BTN_CHECK = ABAP_FALSE
I_DISPLAY_BTN_RESET = ABAP_FALSE
I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).
endmethod.
method INIT_OPTION .
********************************SELECT OPTION初始化**********************************
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(
).
*** 先移除所有选择屏幕
LV_R_HELPER_CLASS->REMOVE_ALL_SEL_SCREEN_ITEMS( ).
DATA:
LT_RANGE_TABLE TYPE REF TO DATA,
RT_RANGE_TABLE TYPE REF TO DATA,
LV_ABAP_BOOL TYPE BOOLEAN VALUE ABAP_FALSE,
READ_ONLY TYPE ABAP_BOOL.
* create a range table that consists of this new data element
RT_RANGE_TABLE =
LV_R_HELPER_CLASS->CREATE_RANGE_TABLE( I_TYPENAME = 'KUNNR' ).
* add a new field to the selection
LV_R_HELPER_CLASS->ADD_SELECTION_FIELD(
I_ID = 'KUNNR'
I_DESCRIPTION = '客户'
I_OBLIGATORY = LV_ABAP_BOOL
IT_RESULT = RT_RANGE_TABLE
* I_IS_NULLABLE = LV_ABAP_BOOL
I_VALUE_HELP_TYPE = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_OVS
I_VALUE_HELP_ID = 'SHLP_KUNNR' "--------select option界面 客户搜索帮助事件名称
).
* create a range table that consists of this new data element
RT_RANGE_TABLE =
LV_R_HELPER_CLASS->CREATE_RANGE_TABLE( I_TYPENAME = 'ANDATUM' ).
* add a new field to the selection
LV_R_HELPER_CLASS->ADD_SELECTION_FIELD(
I_ID = 'ANDATUM'
I_DESCRIPTION = '创建日期'
I_OBLIGATORY = LV_ABAP_BOOL
IT_RESULT = RT_RANGE_TABLE
* I_IS_NULLABLE = LV_ABAP_BOOL
).
* create a range table that consists of this new data element
RT_RANGE_TABLE =
LV_R_HELPER_CLASS->CREATE_RANGE_TABLE( I_TYPENAME = 'ZSTATU1' ).
* add a new field to the selection
LV_R_HELPER_CLASS->ADD_SELECTION_FIELD(
I_ID = 'ZSTATU1'
I_OBLIGATORY = LV_ABAP_BOOL
IT_RESULT = RT_RANGE_TABLE
* I_IS_NULLABLE = LV_ABAP_BOOL
).
* create a range table that consists of this new data element
RT_RANGE_TABLE =
LV_R_HELPER_CLASS->CREATE_RANGE_TABLE( I_TYPENAME = 'ZE_TITLE' ).
* init the select screen
LV_R_HELPER_CLASS->SET_GLOBAL_OPTIONS(
I_DISPLAY_BTN_CANCEL = ABAP_FALSE
I_DISPLAY_BTN_CHECK = ABAP_FALSE
I_DISPLAY_BTN_RESET = ABAP_FALSE
I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).
endmethod.
2013-11-17
展开全部
恭喜!您刚拣到ITPUB送出的新年红包。25PUB币!如果您的浏览器没有自动跳转,请点击这里
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-11-17
展开全部
OVS配合SELECT OPTIONS做东西,这样明白吗?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询