Hello together,
we've implemented the BADI BADI_CRM_BUPA_IL_SEARCH for different business cases. One example: A user from sales org 'ABC' wants only the active business partner from "his" sales org. This means:
- show only business partners with a sales area in the sales org 'ABC' and
- without any entry in the blocking reasons
This works fine. But only for some fields. I did some investigation and found out, that the Badi won't be triggered for every field in BP_HEAD_SEARCH.
It work's for fields like postal code, city and z-fields. But not for business partner number and searchterm.
The separation will be done in the class CL_BUPA_IL_HEADER_SEARCH. There is a method GET_RESULT_TABLE_CHECKED and depending from the fields the method calls different methods:
CONCATENATE 'SEARCH_' iv_shlpname INTO lv_method_name.
* try to call a specific search method:
TRY.
CALL METHOD me->(lv_method_name)
EXPORTING
is_control = ls_control
iv_max_hit = lv_max_hit
it_selection_parameters = lt_selection_parameter
CHANGING
ct_partner_keys = lt_partners
ct_return = lt_return.
CATCH cx_sy_dyn_call_illegal_method. "#EC NO_HANDLER
* no method available, do general part:
ENDTRY.
Method SEARCH_ADDRESS will be called for postal code, city,....
Method SEARCH_BP_GENERAL will be called for business partner number, search term,... And in the SEARCH_BP_GENERAL is a filter for fields like i described.
My question is: Why? Is there any reason why the BADI won't be triggered for these fields? Is there any other BADI? Because of this behaviour we are getting different results depending on the selected fields. We think about adding a z-field in the background. This would trigger the BADI. But i think that isn't a very nice solution.
Do you have any idea?
Best regards,
Sascha