I am trying to filter out the DDLB options for a couple of search criteria in the Trade Promotion Search screen.
Changing filter values for any value help can be achieved by implementing the BADI 'CRM_MKTPL_OL_OBJ' and putting the necessary logic in the method IF_EX_CRM_MKTPL_OL_OBJ~CHANGE_VALUEHELP_ENTRIES of the implementing class.
This works just fine when the value help drop down is in case of elements in the Overview page.
However, when I try to apply the same for the Search, the BADI is not called at all.
The cause of this issue is as follows:
All calls to the afore mentioned BADI happens in method FILTER_VALUE_HELP of class CL_CRM_MKTPL_VH_BOL_PROXY.
However for objects not of the type cl_crm_bol_entity, an exception is thrown at line 8 and the control exits out of the method.
The exception is thrown on this assignment
lr_entity ?= mr_bol_abstr_bo.
Here mr_bol_abstr_bo is an instance of CL_CRM_BOL_DQUERY_SERVICE at runtime and lr_entity is of type CL_CRM_BOL_ENTITY. Hence the move cast error is encountered on the assignment. However both inherit the same abstract class 'CL_CRM_BOL_ABSTR_BO '.
This problem could have been resolved if the object lr_entity was of type CL_CRM_BOL_ABSTR_BO instead of CL_CRM_BOL_ENTITY.
Now coming back to the issue which led to this, is there any easy way to circumvent this issue or ensure that the BADI which filters out the DDLB options is being called in this case for the search Criteria in Trade Promotions.
Thanks and Best Regards,