Hi Abhijit,
In the end, I thought of it in a slightly different way. Rather than thinking the Cost Centre or WBS Element was the thing to be approved, I thought about who the approver really was/how we really wanted to group approvals.
The Approver (username) is how we really wanted to group approvals. That will ensure just one approval appears in their UWL - whether it be cost centre/WBS/mixed.
To save network traffic/RFC calls and efficient response we did the following:
- created two tables: one cost centre, one WBS containing the codes and responsible user
- created an RFC FM on the finance system to collect the cost centre/WBS/approver details
- created a batch report on SRM to refresh the approvers overnight.
In our BADI Implementations:
/SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_AREA_TO_ITEM_MAP
We read the two bespoke tables and took the username from the cost centre/WBS table.
Bespoke Classes:
ZCL_WF_AREA_APPROVER having superclass /SAPSRM/CL_WF_AREA
This Needed code in /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS,
We started out with two further classes - one for Cost Centre, one for WBS. In the end we didn't need them.
Hope this helps.
Best wishes
Paul