cancel
Showing results for 
Search instead for 
Did you mean: 

Check if every workflow step has an approver/processor

benjamin_herzig
Participant
0 Kudos

Hi,

we are on SRM 7 using the classic scenario.

I want to implement a check if every workflow step has an approver/processor.

Example:

I create a shopping cart with cost center accounting. The cost center manager is an approver in our workflow. When a cost center has no manager -> no approver for the workflow step can be found -> workflow runs into an error.

We do not want to use fall back agents. We want to throw an error message in the shopping cart before sending/ordering the shopping cart.

How can i do that? Are there any BADI which i can use?

Thanx and Best regards,

Ben

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Please use BBP_DOC_CHECK BAdi and check for fields if approver has been filled or not. If yes proceed, if no process a error message.

Thanks,

Prashanth

benjamin_herzig
Participant
0 Kudos

Hi,

is there any FM i can use in badi BBP_DOC_CHECK to get the agents?

Best regards,

Ben

Edited by: Benjamin Herzig on Feb 14, 2012 1:30 PM

Former Member
0 Kudos

Please include a method, which checks for approvers (if it is maintained locally or picked from backend) and check if there are any errors.

Thanks,

Prashanth

benjamin_herzig
Participant
0 Kudos

Hi,

how can i get the approvers?

SC is not saved, workitem is not created. I want to get the data which are shown in the approvers preview.

I found a lot of messages about this here, but no solution.

Could you please give me more details?

Best regards,

Ben

laurent_burtaire
Active Contributor
0 Kudos

Hello Benjamin,

inside SC BAdI Check, follow below steps:

1- get SC instance from PDO buffer if available (method GET_BUFFERED_INSTANCE from class interface /SAPSRM/CL_PDO_FACTORY_SC_ADV )

2- get process info if SC is instanciated (class interface /SAPSRM/CL_PDO_BO_SC_ADV )

3- then check decisionset for each process level.

Regards

Laurent.

benjamin_herzig
Participant
0 Kudos

Hi,

i get the instance with


call method /SAPSRM/CL_PDO_FACTORY_SC_ADV=>GET_BUFFERED_INSTANCE
    exporting
      iv_header_guid = iv_doc_guid
    receiving
       ro_instance = lo_instance.

But when i debug into lo_instance and have a look at the decisionset in structure MS_DECISION_SET there are no entries in AGENT_LIST.

Best regards,

Ben

laurent_burtaire
Active Contributor
0 Kudos

Hello,

use PROC_LEVEL_LIST table from PROC_DETAIL_LIST table being component from type /SAPSRM/S_PDO_WF_PROCESS_INFO (exporting parameter from class interface /SAPSRM/CL_PDO_BO_SC_ADV ).

Regards.

Laurent.

benjamin_herzig
Participant
0 Kudos

Hi,

thank you very much so far.

/SAPSRM/CL_PDO_BO_SC_ADV=>GET_SC_ADV_INSTANCE have mandatory Importparameter "workitem id". But i don´t have the workitem id. The workitem will be created later.

Best regards,

Ben

Former Member
0 Kudos

Hi,

You have to use BBP_DOC_CHECK BAdi , you have to build the logic in a z class and pass the SC_GUID. in the custom class use the bbp_procdoc_getdetail FM to get the current SC value and check if the current SC has valid approvers.. if not then raise the error message.. the reason why i ask you to create the Z class is , you can use the same class for WF..