cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate Removal in BRF

0 Kudos

Dear All

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

velu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

You will need 3 process levels

process level1 - event (expression1) aprover : X1

process level2-event(expression2) approver:X2

process level3- event(expression3) approver: X3

Regards

Sam

0 Kudos

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

velu

laurent_burtaire
Active Contributor
0 Kudos

Hello Velu,

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.

Regards.

Laurent.

0 Kudos

Thanks for the response.

The method /SAPSRM/CL_PDO_FACTORY_SC_ADV ~GET_BUFFERED_INSTANCE has an import

parameter " IV_HEADER_GUID". How to get this value from the "SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS method .

Thanks and Regards

velu

laurent_burtaire
Active Contributor
0 Kudos

Hello,

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.

Regards.

Laurent.

0 Kudos

Thanks for the response.

We are trying to code as suggested and the code is as shown below.

data :

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

RECEIVING

RO_TASK_CONTAINER_FACTORY = temp_task_container_factory "

.

CALL METHOD TEMP_TASK_CONTAINER_FACTORY->GET_TASK_CONTAINER

  • EXPORTING

  • IV_TRANS_MODE =

  • IO_MESSAGE_HANDLER =

  • IV_BO_TYPE =

RECEIVING

RO_TASK_CONTAINER = temp_task_container

CALL METHOD TEMP_TASK_CONTAINER->GET_BO_GUID

RECEIVING

RV_BO_GUID = ins_guid .

TRY.

CALL METHOD /SAPSRM/CL_PDO_FACTORY_SC_ADV=>GET_BUFFERED_INSTANCE

EXPORTING

IV_HEADER_GUID = ins_guid

RECEIVING

RO_INSTANCE = temp_instance

.

ENDTRY.

CALL METHOD ZCL_WF_APV_FACADE=>RETRIEVE_PROCESS_HISTORY

EXPORTING

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

IMPORTING

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

velu

Former Member
0 Kudos

Hello,

Is there any other method or instance which is supposed to call in order to find guid as it is coming empty?

Please suggest. Waiting for the reply.

Thnak you.

0 Kudos

Laurent

We have tried as suggested and the "GET_BO_GUID " method is not returning the GUID. Coudl you please let us know what is wrong with the code?.

Thanks and Regards

velu

laurent_burtaire
Active Contributor
0 Kudos

Hello,

try with /SAPSRM/CL_CH_WD_TASKCONTAINER class.

Regards.

Laurent.

Former Member
0 Kudos

Hi Velu,

Did you happen to find a solution to this requirement?

I have a similar requirement.

Regards,

Pratham

Former Member
0 Kudos

Hi Velu/Pratham,

I am having similar requirement. Could you guys please let me know how you handled it ?

Usefull inputs will be rewarded with points..

Regards,

Arunkumar B