| # Created by Jerry Wang on Jun 04, 2014有客户需要在custom development里直接调用底层的Product search function module,例如CRM_PRODUCT_GETLIST2。 通过SAT trace能发现 ACE的相关preparation逻辑是在该FM之外执行的,因此如果直接调用FM,就会缺少ACE的检查。 通过下面的report做法,可以做到既使用底层的API实现搜索,又能实现ACE逻辑参与到整个search scenario里去:```
DATA lr_search_scenario TYPE REF TO cl_com_prsearchscenario_base. DATA lr_bsp_ace_instance TYPE REF TO if_ex_com_product_bsp_ace. DATA lt_search_criteria TYPE comt_prsearch_criteria_tab. DATA lt_selection TYPE comt_prsearch_selection_tab. CREATE OBJECT lr_search_scenario TYPE cl_com_prsearchscenario_getlst. CALL METHOD cl_com_product_badi_factory=>get_badi_instance EXPORTING iv_badi_name = 'COM_PRODUCT_BSP_ACE' IMPORTING ev_badi_instance = lr_bsp_ace_instance. IF lr_bsp_ace_instance IS NOT INITIAL. CALL METHOD lr_bsp_ace_instance->prepare_searchscenario EXPORTING ir_prsearchscenario = lr_search_scenario CHANGING ct_searchcriteria = lt_search_criteria. ENDIF. CALL METHOD lr_search_scenario->getlist EXPORTING iv_max_rows = 100 iv_request_data = abap_true it_criteria = lt_search_criteria IMPORTING et_selection = lt_selection EXCEPTIONS OTHERS = 0.
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
###
### [](https://github.com/i042416) [i042416](https://github.com/i042416) added the [CRM Product](https://github.com/i042416/KnowlegeRepository/labels/CRM%20Product) label [on Oct 14, 2017](https://github.com/i042416/KnowlegeRepository/issues/566#event-1293397187)
[](https://github.com/i042416)
Owner Author
### **[i042416](https://github.com/i042416)** commented [on Oct 12, 2018](https://github.com/i042416/KnowlegeRepository/issues/566#issuecomment-429269530)
| # some ACE debugging[](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/aed03991e318485abe9d212898d58980~tplv-k3u1fbpfcp-zoom-1.image) [](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d6c475410e8a4da8bdde60e3dff0d5fb~tplv-k3u1fbpfcp-zoom-1.image) [](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bff2ad4dbff24c6b8c0bfd4a31b549fd~tplv-k3u1fbpfcp-zoom-1.image) [](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7087d51eafdd4802bc52ea80251a812f~tplv-k3u1fbpfcp-zoom-1.image) [](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/efaddb3979474ba28efc0b610c8533c3~tplv-k3u1fbpfcp-zoom-1.image) [](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/2aa9d593d27743d9bbafdd7136c117f4~tplv-k3u1fbpfcp-zoom-1.image) |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |