Enable Dynamic Parallel Approval For Company Code Data in Rule-Based Workflow
Enable Dynamic Parallel Approval For Company Code Data in Rule-Based Workflow
Applicable Releases:
All
Version 2.0
April 2022
Document History
3
1. BUSINESS SCENARIO
SAP Master Data Governance provides business processes to find, create, change, and mark master data for deletion.
It supports the governance of master data in a central hub and the distribution to connected operational and business
intelligence systems.
The processes are workflow-driven and can include several approval and revision phases, and the collaboration of all
users participating in the master data maintenance.
MDG-F uses the standard workflow templates WS75700027 and WS75700040 as default templates. However, the
rule-based workflow template WS60800086 can also be used. This How To Guide describes an example of the
account approval process using the decision tables of the rule-based workflow and create parallel approval workflow
steps when the parallel number is determined dynamically. The guide shows all relevant customizing and
implementation details.
4
2. BACKGROUND INFORMATION
The Business Add-In (BAdI) USMD_SSW_PARA_RESULT_HANDLER is used to merge the result of the parallel
workflow items. You can use this BAdI to implement the result of a parallel workflow merge in the rule-based workflow.
The BAdI uses the method HANDLE_PARALLEL_RESULT to handle and merge the results of the parallel workflows
into one result. The input for this BAdI is the change request number, current step number, parallel step action table,
and the service name. By using the change request number, it is possible to access all data within this change request.
The input parameter Service Name enables you to use the same BAdI implementation for multiple service names. For
example, when two service names are used in the configuration of the same change request workflow, and the user
wants to create only one BAdI implementation, having the service name as the input parameter enables you to
separate the processing logic based on the service name input. With this BAdI you can change the workflow generic-
context table in the workflow. This BAdI also returns the next workflow step, the action taking place in the workflow
step, and the message table.
Requirements
You have defined the filter value Service Name in view V_USMD201C_SSW. You need to create a separate
implementation for the handling of a specific parallel result.
Standard settings
For more information about the standard settings (filters, single or multiple uses), see the Enhancement Spot Element
Definitions tab in the BAdI Builder (transaction SE18). No default BAdI implementation is preactivated in the standard
system. The BAdI is filter-dependent. The BAdI is not designed for multiple uses.
Activities
For information about implementing BAdIs in the context of the Enhancement Concept, see the SAP Library for SAP
NetWeaver under BAdIs - Embedding in the Enhancement Framework.
5
3. STEP BY STEP EXPLANATION
3.1. Customizing
6
3.1.2. Define Workflow Step
7
3.1.3. Activate Highlighting
8
3.1.5. BRF+ Tables
Start transaction MDGIMG. Navigate to General Settings > Process Modeling > Workflow > Rule-Based Workflow >
Configure Rule-Based Workflow. Enter the newly created change request type and press Continue. Set up the BRF+
tables.
9
Ste
Explanation Screenshot
p
Follow the customizing path.
3 Create Enhancement
Implementation, BAdI
Implementation (do not copy any
sample class, create empty
implementation and empty class),
BAdI Implementation and
Implementing Class. Leave the
implementation of the interface
method
IF_USMD_SSW_SYST_METHOD_CA
LLER ~CALL_SYSTEM_METHOD
empty.
10
4 Navigate to the Filter Values for the
BAdI implementation and go to edit
mode. Create a filter. Double-click
the combination or press Value.
In pop-up Change Filter Value
enter/ select the relevant data.
Press Continue.
Press Save and Activate.
Ste
Explanation Screenshot
p
1 Start transaction SE18. Select option Enhancement
Spot Name and enter
USMD_SSW_SERVICE_PROCESSOR Press Display.
11
4 In pop-up Select or Create Enhancement
Implementation amongst others the new
enhancement implementation is listed. Select it and
press Select Specified Enhancement
Implementation.
In pop-up Create BAdI Implementation enter the
necessary data:
Press Continue.
12
9 Go to edit mode. Change the example
implementation according to your needs. Activate
the method. In case other objects are still to be
adjusted, select them too for activation.
13
3.2.3. Create Enhancement Implementation for USMD_SSW_DYNAMIC_AGENT_SELECT
In this chapter a Business Add-In (BAdI) implementation for BAdI USMD_SSW_DYNAMIC_AGENT_SELECT is
created. This BAdI uses the method GET_DYNAMIC_AGENTS to implement dynamic agent selection in the rule-
based workflow. You might refer to the BAdI documentation for further details. The service name defined in a previous
chapter serves as BAdI filter. The actual implementation of the BAdI method depends on the use case that should be
accomplished.
3
Navigate to the Filter Values for the BAdI
implementation and go to edit mode. Create
a filter, matching the service defined in IMG
activity Define Service Names for Rule-Based
Workflow.
14
Implementation proposal:
The method reads all company codes of the account that are requested by the current change request, and then reads
the relevant approver and sets it to the exporting parameter CT_USER_AGENT_GROUP of method
IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS.
To implement this method, perform the following steps:
1. Retrieve the object list of change request IV_CR_NUMBER by calling the data model method or reading the
USMD1213 table.
2. Normally a customer table stores the approvers for company codes. You can find all relevant approvers (by
user or organizational unit) using the object list of company codes. Or you have other logic to find the relevant
approvers which is not scope of this document.
3. Each entry in CT_USER_AGENT_GROUP represents one branch of parallel approval steps. Enter STEP_TYPE
as value 2. AGENT_GROUP should be unique for all entries.
In case there is only one company code or only one branch is generated, in order to make the decision
table easy, it’s recommended to use second branch using dummy system call, like this:
15
4. Set the return step as CV_NEW_STEP.
16
4. PROCESS
In this chapter the new process is tested. A G/L account is created using the newly created and configured change
request type ZACC1P1 and parallel workflow items are created.
17
Workflow log after submission:
18
Afterwards, all parallel work items are approved:
19
5. ADDITIONAL INFORMATION
5.1. Further Reading
Product SAP Master Data Governance https://www.sap.com/products/master-data-governance.html
20
www.sap.com/contactsap
The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National
product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein.
This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may
be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or
functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on
these forward-looking statements, and they should not be relied upon in making purchasing decisions.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their respective companies. See www.sap.com/trademark for additional trademark information and notices.