Hi Jerry Cui,
i will give you a brief explanation about the requirement how to do..
1 enhance the component and then create your views. ( already you have done this step).
2 in your first view impl class create 2methods zsearch_work_flows_with_maxhits( ), zsearch_work_flows( ) in this method you have to filtered your result no need to create another method as you provide filtered_work_rows.
3. in the standard search_work_flows methods there is a logic like this and manipulate according to your requirement over here..
DATA: lr_wi_dquery TYPE REF TO cl_crm_bol_dquery_service,
lr_result_collect TYPE REF TO if_bol_entity_col,
lr_view1col TYPE REF TO cl_crm_bol_bo_col.
lr_wi_dquery = cl_crm_bol_dquery_service=>get_instance( if_crm_wf_gc=>c_wf_search_dynamic ).
lr_wi_dquery->set_property( iv_attr_name = 'MAX_HITS' iv_value = -1 ). "#EC NOTEXT
lr_result_collect = lr_wi_dquery->get_query_result( ).
" here lr_result_collect you will all the result collection in this collection you have to filter and manipulate according to your requirement.
CREATE OBJECT lr_view1col.
lr_entity ?= lr_result_collect->get_first( ).
WHILE lr_entity IS BOUND.
lr_entity->get_property_as_value( EXPORTING iv_attr_name = 'WI_STAT ' IMPORTING ev_result = lv_status ).
case lv_status.
when lv_staus = 'draft'.
" collect the entitys and add to your collection view1.
ex:
lr_view1col->if_bol_bo_col~add( iv_entity = lr_entity ).
when lv_status = '2nd status'.
" collect the entitys and add to your result collection to view2.
lr_view2col->if_bol_bo_col~add( iv_entity = lr_entity ).
when lv_status = '3rd status'.
lr_view3col->if_bol_bo_col~add( iv_entity = lr_entity ).
endcase.
" get the custom controller instance..
lr_cuco ?= get_custom_controller( 'zcucoinstance/CUSTCUCO' ).
IF lr_cuco IS BOUND.
lr_cuco->typed_context->view1cn->collection_wrapper->set_collection( lr_view1col ).
lr_cuco->typed_context->view2cn->collection_wrapper->set_collection( lr_view1col ).
lr_cuco->typed_context->view3cn->collection_wrapper->set_collection( lr_view1col ).
ENDIF.
4 bind the custom controller to view1 ,2,3.
5 go to each and every view config and display the fields what fields you want to display as a result..
i think this will guide how to achieve your requirement..
otherwise you will filter by using badi this is the badi i think..
go to se 18 provide CRM_IC_INBOX_BADI and display there is a method AFTER_SEARCH. after manipulation this will give the collection that any way reflected to same result collection lr_result_collect = lr_wi_dquery->get_query_result( ). method of search.
if any doubts let me know.
Regards,
Srinivas.