So I am wanting to Restrict the Search Result the user see's based on if they have display access for for the BP role. i.e.(The user has display access to Sold-to but doesn't for Ship-to). So when the user does a search I don't want any Ship-to BP's returning.
Here is what I have tried:
1.BADI_CRM_BP_UIU_AUTHORITY implementing interface IF_UIU_BP_AUTHORITY~CHECK_EDIT. This doesn't work obviously because its only for editing a BP.
2.BADI_CRM_BUPA_FILTER_BPROLE. This doesn't work for my issue b/c the user can search by BP ID and display all BP types.
Here is what I am thinking and maybe need a little input on.
Option 1. Looping through the results in componen/view BP_HEAD_SEARCH/MainSearch in event EH_ONSEARCH and removing the BP's that the user doesn't have access to display.
Option 2. Use BADI CRM_ACC_SEARCH implementing IF_EX_CRM_ACC_SEARCH~CHECK_OBJECTS using the same type of logic as Option 1. Removing the BPs from the results.
I'm wondering which option would be best and if there are any other options to this solution.
Thanks in Advance!!!