We are building a multi-level BRF work flow. There are 5 levels of approval. we need to remove the duplicate approvers from the levels.
Level 1 - approver = X1 ( immediate manager)
Level 2 -- approver = X1 and X2 ( Cost center approver)
Level 3 -- approver = X2 and X3 ( Category approver )
The goal is to make ( By removing the duplicates across the Levels)
Level1 = X1
Level 2 = X2
Level 3 = X3
any idea how this could be acheived?.
Thanks and Regards
The levels are defined and a BADI has been implemented for each level. The expression is also defined ( say for the case of cost center approval it is >5000 USD). The issue is how remove the duplicates on different levels and recalculate the approvers based on various duplicates across levels?.
Level 1 ( Manager) : Assume the immediate Manger is X1.
Level 2 ( Cost Center Approver ) : The Cost Center approvers are either X1 and X2. ( based on a ztable that holds the cost center approvers). Any one of X1 and X2 can approve.
The idea is to remove X1 and bring only X2 for Level 2, as X1 is already an approver for Level 1 and hence can't receive the work-item for Level 2. If the Level 1 approver is X5 ( instead of X1 ), then level 2 approvers are X1 and X2.
We are trying different things like trying to get a handle of the shopping cart instance in Area_GUID method. This will allow us to find the approvers of previous level and this list can be used to eliminate the duplicate for the current level. We are not successful so far.
Any help/ideas to resolve this is very much appreciated.
Thanks and Regards
you could get the SC instance from the PDO buffer ( SAPSRM/CL_PDO_FACTORY_SC_ADV=>GET_BUFFERED_INSTANCE ). Then, get the process info if the SC is intanciated ( /SAPSRM/IF_PDO_DO_APV_EXT~GET_PROCESS_INFO ).
Then, check export parameter ES_PROCESS_INFO to get previous levels (table PROC_DETAIL_LIST ).
You will have to implement your code inside method /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS from a specific class created in reference to class /SAPSRM/CL_WF_AREA and for your Responsabilty Resolver Name.
Try to get factory instance for tack container using /SAPSRM/IF_CLL_TASKCON_FACTORY interface with method GET_INSTANCE from class /SAPSRM/CL_CH_WD_TASKCONT_FACT.
Then, get task container from this interface.
Now, you can get SC GUID using GET_BO_GUID method.
Thanks for the response.
We are trying to code as suggested and the code is as shown below.
temp_task_container_factory type REF TO /SAPSRM/IF_CLL_TASKCON_FACTORY,
temp_instance type REF TO /SAPSRM/IF_PDO_BO_SC_ADV,
ins_guid type BBP_GUID, "/SAPSRM/WF_DOCUMENT_GUID,
ls_process_info TYPE /SAPSRM/S_PDO_WF_PROCESS_INFO,
temp_handler TYPE REF TO /SAPSRM/IF_PDO_STATIC_META,
temp_task_container type REF TO /SAPSRM/IF_CLL_TASK_CONTAINER,
lo_task TYPE REF TO /SAPSRM/IF_CLL_TASKCON_FACTORY.
CALL METHOD /SAPSRM/CL_CH_WD_TASKCONT_FACT=>GET_INSTANCE
RO_TASK_CONTAINER_FACTORY = temp_task_container_factory "
CALL METHOD TEMP_TASK_CONTAINER_FACTORY->GET_TASK_CONTAINER
RO_TASK_CONTAINER = temp_task_container
CALL METHOD TEMP_TASK_CONTAINER->GET_BO_GUID
RV_BO_GUID = ins_guid .
CALL METHOD /SAPSRM/CL_PDO_FACTORY_SC_ADV=>GET_BUFFERED_INSTANCE
IV_HEADER_GUID = ins_guid
RO_INSTANCE = temp_instance
CALL METHOD ZCL_WF_APV_FACADE=>RETRIEVE_PROCESS_HISTORY
IV_DOCUMENT_GUID = ins_guid " we are passing ins_guid instead of zGC_MOCK_PDO_GUID this should have area_guid now.
IV_AGENT_ID = lv_agent
IV_LANGUAGE = sy-langu
ES_PROCESS = ls_process.
But the ins_guid ( returned by RV_BO_GUID ) is empty ( The Bold fonted line of code)
Are we missing some thing?. Could you please let us know the code is fine?.
Thanks and Regards