on 12-18-2013 7:37 AM
Hi all,
I have a requirement to filter service request search based on authorization provided for particular user.
Suppose we have 2 types of service requests say A and B.
There are 3 agents X, Y and Z.
X has authorization for A so he should able to search only A type service requests. Similarly Y should be able to search B type and Z should be able to search both A and B types.
When i click on search button CL_CRM_SRQM_COMMON_SR_CNTRL->perform_search( ) method is getting called. How do i use to achieve my requirement? Please give some hints or if you any better approach please suggest.
CL_CRM_SRQM_COMMON_SR_CNTRL is an abstract class.
Component : SRQM_INCIDENT_S
Thanks and Regards,
Pallavi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi pallavi,
Hope you have done this requirement.
I dint had any system to do any changes, so delay in response.
i checked now, you can use filter by taking reference to below code(do changes according to u ) it working fine for filter search:-
METHOD eh_onsearch_btn_clicked.
*CALL METHOD SUPER->EH_ONSEARCH_BTN_CLICKED
** EXPORTING
** htmlb_event =
** htmlb_event_ex =
* .
DATA: lv_viewname TYPE string,
lr_view_ctrl TYPE REF TO cl_crm_srqm_common_sr_cntrl.
lv_viewname = me->get_viewarea_content( if_crm_srqm_uiu_const=>gc_viewarea_search ).
ASSERT lv_viewname IS NOT INITIAL.
lr_view_ctrl ?= me->get_subcontroller_by_viewname( lv_viewname ).
lr_view_ctrl->perform_search( ).
DATA: lr_search_result_cn TYPE REF TO cl_bsp_wd_context_node,
lr_sr_model TYPE REF TO cl_bsp_model,
lr_collection TYPE REF TO cl_bsp_wd_collection_wrapper,
lr_iterator TYPE REF TO if_bol_bo_col_iterator,
lr_fltr_ents TYPE REF TO if_bol_bo_property_access,
rv_result TYPE REF TO if_bol_bo_property_access.
CALL METHOD lr_view_ctrl->get_model
EXPORTING
model_id = 'searchresult'
RECEIVING
model_instance = lr_sr_model.
lr_search_result_cn ?= lr_sr_model .
CALL METHOD lr_search_result_cn->get_collection_wrapper
RECEIVING
rv_result = lr_collection.
CALL METHOD lr_collection->if_bol_bo_col~get_iterator
RECEIVING
rv_result = lr_iterator.
IF lr_iterator IS BOUND.
CALL METHOD lr_iterator->filter_by_property
EXPORTING
iv_attr_name = 'DESCRIPTION'
iv_value = 'Test Table'.
CREATE OBJECT lr_collection.
rv_result = lr_iterator->get_first( ).
WHILE rv_result IS BOUND.
CALL METHOD lr_collection->if_bol_bo_col~add
EXPORTING
iv_entity = rv_result
* iv_set_focus = ABAP_FALSE
.
CALL METHOD lr_iterator->get_next
RECEIVING
rv_result = rv_result.
ENDWHILE.
lr_search_result_cn->clear_collection( ) .
CALL METHOD lr_search_result_cn->set_collection
EXPORTING
collection = lr_collection.
lr_sr_model = lr_search_result_cn .
CALL METHOD lr_view_ctrl->set_model
EXPORTING
model_id = 'searchresult'
model_instance = lr_sr_model.
ENDIF.
ENDMETHOD.
Regards,
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.