Process-controlled workflows are available for the following business objects:
We will see the example for Shopping cart workflow using PROCESS CONTROLLED WORKFLOW (BRF).
Automatic assignment of approvers/approvals. Users may not be able to change the default Approver.
Approver determination is based on position in the Organizational Hierarchy (i.e. ‘head of org unit’).
Shopping cart approval is based on the value of the highest dollar line item of the shopping cart.
All shopping carts require Approval. The main criteria for shopping cart approval are: K-Level of Manager, Company Code, Account Assignment Category, Item Type, and Approval Limit monetary amount per the currency used on the shopping cart.
The approval process in BRF typically run on several process levels. So we need to define the process levels as below.
The process level configuration will be done in the below path using SPRO transaction:
SAP Implementation Guide -> SAP Supplier Relationship Management -> SRM Server -> Cross-Application Basic Settings -> Business Workflow -> Process Controlled Workflow -> Business Process Configuration -> Define Process Levels
Select the Object type as BUS2121 and click on ‘Process level configuration’ on left hand side.
We need to enter the ‘Process level schema’ as below.
The below are the process levels as below. Here as per the requirement we have created the two process levels. One is for N – level approvals and another one is for automatic system approvals.
Note: we have the standard evaluation ID ‘0EV_SC_SL2’ and responsible resolver name ‘RR_SPENDING_LIMIT_APPROVER’ to achieve the N-Level approval process in shopping cart.
How N-Level Approval Process will work:
We need to create process level using the evaluation ID ‘0EV_SC_SL2’ and responsible resolver name ‘RR_SPENDING_LIMIT_APPROVER’.
This will get the approver name and approval limit of manager of org unit from the SLAAPPROVER attribute.
PPOSA_BBP: Here we can maintain the approval limit for the manager. The standard BADI implementation has logic to fetch the approval limit from the org unit.
But we have created the Z evaluation ID and Z responsible resolver name because of the below requirement.
In our scenario, we have the K-Level attribute in the org unit for the manager, here they will maintain the level like K1, K2…and based on the K-level, company code and account category we need to get the approval limit from Z table.
The evaluation ids like Z_SC_NSTEP, 0EV999 are also the events.
In the expression, we have the formula. Check is the spending limit of the approver is less than the most expensive line item.
In the expression, we have given the parameters as below, mentioned the Z class name and method to get the previos limit of the approver. Here we can write our own logic.
Also created the Z responsible resolver name ‘Z_KLEVEL_APPROVER’ as below. Which will be used as filter values for BADI implementations.
The below is the path to create the Z responsible resolver name.
SAP Implementation Guide -> SAP Supplier Relationship Management -> SRM Server -> Cross-Application Basic Settings -> Business Workflow -> Process Controlled Workflow -> Business Process Configuration -> Define Filter Values for BAdi ‘Define Agents’.
The below standard BADI will create the process levels:
So we have created the implementation for this as below.
Also given the filter value as ‘Z_K_LEVEL_APPROVER’
In this method, we will write our own logic to create the process levels dynamically.
Note: the scenario is: we have created the process level 100, but the requirement is the shopping cart should send for N- level approvers based on the most expensive line item of shopping cart.
Example: I have created the cart with 1000$ and in the org unit we have TESTMGR1 has approval limit 500$ and TESTMGR2 has approval limit as 1200$. Now the shopping cart should sent for 2 level approvers. So we need to create the 2 process level dynamically.
In our scenario: we will get the document responsible person and will fetch manager. And again will pass the manager and get the manager of manager. This will be done in a while loop. So that we will get all the managers in the org unit and K-Levels. And will create the number of process levels based on the number of managers in the org unit.
Till the program finds the valid list of approvers, the process levels will be repeated based on the formula in the expression. (Spending limit of approver<Most expensive line item).
Based on the configuration, the below BADI /SAPSRM/BD_WF_RESP_RESOLVER will get the approvers.
So create the implementation for this BADI and will maintain the filter value as ‘Z_K_LEVEL_APPROVER’.