
Hierarchical Approval Workflow
Use
In a hierarchical approval procedure, one agent must agree before the next agent can decide. Each agent has the option of rejecting the request therefore terminating the entire procedure.
Since the workflow can be terminated by any agent, it is very important that the hierarchy be respected (lower positions first, higher positions last), because it would not make sense for a managing director's decision to be nullified by a head of department, for example. This logical sequence cannot be checked by the wizard, so must be defined correctly by the user.

An administrator needs a new PC and enters a purchase order starting a workflow for approval.
First their head of department must agree, and then a designated agent from the IT department must grant their approval. Lastly an employee from Controlling must grant their approval to finally release the purchase order.
Another possibility is that the approvers are on the same hierarchical level but can belong to different departments. The basic principle is otherwise the same.

First a Financial Accounting clerk (from several possible) must agree and then a Controlling administrator (from several possible). It may also make sense, within the double verification principle, for two or more agents from the same department to carry out an approval.
At definition time, you define the following for the hierarchical approval workflow: the type of the object to be approved, the
approval task, the number of approval levels, and the actual agents for each level.Prerequisites
The object types that are to use an automatically created approval procedure must have an approval method. It is best if these object types support the
interface approval, which incorporates a method for approval and whose interface is ideal for the Workflow Wizard.The object type should also always have a method for displaying objects, which should be entered as default method, because the Workflow Wizard integrates the default method of the object type to be approved into the approval step as a secondary method during instantiation.
Features
The Workflow Wizard for hierarchical approvals can be used to create approval procedures with any nesting level.
In the first step of every approval procedure, the approval status (container element
ApprovalState ) is first initialized with the number of hierarchical levels, that is the number of approvals to be granted.This initialization is followed by the approval steps nested in each other, all of which have at least two possible results (approved or rejected). The approval method of the object to be approved is executed and, optionally, its default method as a secondary method. This execution takes place asynchronously in a new session without influencing the execution of the workflow.
In the event of approval, the approval status is decreased by one and the next approval step initiated. Once all agents have agreed, this is therefore zero.
In the event of rejection, nothing happens and the workflow goes immediately to its evaluation part. If the approval procedure is terminated in this way, the approval status is always greater than zero.
For more information, see
Evaluation Part of All Approval Workflows.Enhancements to the workflow definition
You still need to enhance the workflow definition created by the Workflow Wizard, by adding steps in which the object to be approved is created or determined.
A reference to this object must be stored in the container element
ApprovalObject in the workflow container.Activities
A hierarchical approval procedure created by a wizard requires certain additional elements in the workflow container, which are created by the workflow system:
Data type |
Description |
Explanation |
Object reference |
Approval object ( ApprovalObject ) |
Reference to the object to be approved. The object to be approved and the approval task must be determined at definition time. |
|
List of addresses |
Reference to the address objects of those who are informed of the approval. | |
ABAP Dictionary reference |
Approval status ( ApprovalState ) |
Status of the approval procedure. The status is initialized at the start at the number of approval levels, and decreased by one with each approval. If the status is zero on evaluation, the object was approved. If it is greater than zero, the object was rejected. |
|
Actual agent ( CurrentAgent ) |
The user processing the work item is stored in this container element. | |
|
List of excluded agents ( ExcludedAgents ) |
The list of agents contains all users, positions, jobs, organizational units and work centers that have been involved in the approval process.This list is used to exclude agents who have already granted an approval from approving the same object again. You can also include the workflow initiator in this list. This prevent applicants from being able to approve their own requests. | |
|
Approval result ( Result ) |
This field contains the result of the approval procedure after the workflow: A for approved |