Created by Jerry Wang, last modified on Apr 01, 2015
use the following link to test filter logic: ( filter by status = open )
https://:4080/sap/opu/odata/sap/CRM_OPPORTUNITY/Opportunities?$skip=0&$top=20&$filter=UserStatusCode eq 'I1002'
in this case get_system_status will never be called:
instead, the filter option passed by the consumer will be handled:
However, in the result list, E0001 is filled instead of I1002.
trace如下代码:
首先读出所有的CRM status:
此处会将I1002对应的status转换成E0001:
REPORT zlock1. DATA: lr_1o_search TYPE REF TO cl_crm_q1o_search. DATA: lt_guidlist TYPE crmt_bsp_objectkey_tab. DATA: lt_oppt TYPE REF TO data. DATA: lt_return TYPE bapiret2_t. DATA: ls_return TYPE bapiret2. DATA: lt_selection_parameter TYPE genilt_selection_parameter_tab, ls_selection_parameter LIKE LINE OF lt_selection_parameter. FIELD-SYMBOLS: <oppt> TYPE any, <oppt_tab> TYPE ANY TABLE. CREATE OBJECT lr_1o_search. CHECK lr_1o_search IS BOUND. ls_selection_parameter-attr_name = 'RESPONS_AREA'. ls_selection_parameter-option = 'EQ'. ls_selection_parameter-sign = 'I'. ls_selection_parameter-low = '2'. APPEND ls_selection_parameter TO lt_selection_parameter. ls_selection_parameter-attr_name = 'STATUS'. ls_selection_parameter-low = 'I1002'. APPEND ls_selection_parameter TO lt_selection_parameter. CALL METHOD lr_1o_search->set_selection_parameters EXPORTING iv_obj_il = cl_crm_odata_oppt_constant=>gc_oppt_obj_il it_selection_parameters = lt_selection_parameter IMPORTING et_return = lt_return EXCEPTIONS partner_fct_error = 1 object_type_not_found = 2 multi_value_not_supported = 3 OTHERS = 4. CREATE DATA lt_oppt TYPE TABLE OF crmst_query_r_opp_btil. ASSIGN lt_oppt->* TO <oppt_tab>. CALL METHOD lr_1o_search->get_result_values EXPORTING iv_max_hits = 100 IMPORTING et_results = <oppt_tab> et_guid_list = lt_guidlist et_return = lt_return.
更多推荐
Opportunity search filtered by status
发布评论