MORE PUR FS ApprovalWorkflow MORE-297 V11
MORE PUR FS ApprovalWorkflow MORE-297 V11
Change History:
Contents
1 General information.................................................................5
1.1 Authors of the Concept and Solutions resolution document..................5
1.2 Review list............................................................................................. 5
1.3 Approval/Sign-off list.............................................................................. 5
2 Introduction.............................................................................6
3 Context....................................................................................7
3.1 Process Overview.................................................................................. 7
3.2 Approval Steps...................................................................................... 10
3.2.1 Approver Determination Rules at MAHLE..........................................10
3.2.2 Purchase Requisition Approval..........................................................14
3.2.3 Purchase Order Approval...................................................................15
3.3 Process Descriptions.............................................................................. 17
3.3.1 Create Purchase Requisition – Procurement Hub...............................17
3.3.2 Create Purchase Requisition – Guided Buying...................................21
3.3.3 Approve Purchase Requisition...........................................................25
3.3.4 Conversion to Purchase Order...........................................................29
3.3.5 Transfer Purchase Order to Hub........................................................29
3.3.6 Approve Purchase Order....................................................................30
3.3.7 Cancel / Recall / Restart Workflow.....................................................31
3.4 Additional Requirements.......................................................................32
3.4.1 Handling of Approval Notes...............................................................32
3.4.2 Four-Eyes Principle (Approver = Requester)......................................32
3.4.3 Mail Notifications............................................................................... 32
3.4.4 Reminder / Escalation Process...........................................................32
3.4.5 Error Handling / Workflow Administration..........................................33
3.4.6 Approval Preview...............................................................................34
3.4.7 Substitution Rules..............................................................................34
3.4.8 Approval workflow history.................................................................35
3.5 Out of Scope.......................................................................................... 35
4 Solution Design........................................................................36
4.1 System Landscape / Architecture..........................................................36
1 General information
1.1 Authors of the Concept and Solutions resolution document
Prior to the approval of the design, the following individuals have reviewed this
document:
Name Role
Sven Bresser Functional Consultant
Name Role
Herr Ehrhardt Controlling & Systems Global Purchasing Non Production Material
(TXC)
2 Introduction
The purpose of this document is to describe the concept and solution for the MORE
template for the respective user story in terms of system functionality (customizing
rationale and enhancements).
3 Context
In this chapter, the proposed solution is described from a functional perspective.
The following overview shows the integration of the approval processes into the
high-level end-to-end procurement process.
The following tables provide an overview and description of the different approval
steps (internal, external and optional approvals) including the following information:
- The purchase requisition / purchase order data will be evaluated in the Hub
according to the ASG and the roles responsible for approval will be determined
(e.g. line manager, plant manager or regional manager)
- As there are different rules for different ASG roles to identify the correct
person, a table will be created to define which rule is the correct one to
identify the correct person.
(“assignment of approver to
codes”)
If there is no rule number assigned in the table than the fall back rule is the R01 rule
(= cost center owner + boss in line organisation)
This table with the rules should be editable so that further rules can be added in the
future.
Related to Rule 03, there should be exactly one person determined. Therefore, the
following information and parameters needs be added to the existing “ASG
approver” list:
Existing parameters:
- MAHLE User ID
- ASG Role number
Additional parameters:
- Region
- Country
- Material group code range
- SAP plant code
- Log System
The additional parameters are needed twice, on the one hand for internal ASG role
and on the other hand for external ASG role (e.g. it is possible that one person has
internal an ASG role just for DE but an external ASG role with responsibility for EU in
total).
Due to this, a table will be implemented to define the region and country by SAP
plant code which enable MAHLE to maintain in “ASG approver” table just the region
or country instead of naming all plant codes.
- The determined role and specific document data (accounting responsible, total
value, account assignment) will be passed to the local approver table / MIAM
interface, which returns the responsible user(s)
- MAHLE wants also the possibility to activate some additional steps. Therefore,
two optional workflow steps will be implemented within the PR and one will be
implemented within the CPO workflow for special cases. These steps can be
maintained within a table, the user IDs are assigned directly (not via business
role codes).
For release 1, a local version of the ASG containing all relevant entries for the pilot
will be maintained in the Hub (as a BRFplus decision table). In the next step, a global
solution will be developed by the Architecture stream.
Due to this restriction, header-based approval will be used. With this approach, it
is still possible to assign multiple approvers to the same approval step (e.g. based on
material groups or account assignments). All users receive a workitem in parallel and
have to processes it before the next approval step is started. The main difference to
the item-based approval is that each approver has to decide on the whole document
and not just a specific set of items.
If needed, it would be possible to extend the UIs, so that the approver only sees the
items relevant for him. A solution proposal and effort estimation is provided in
chapter 4.4.8.
The possibility to change document data within the “My Inbox” app is not
supported in the standard delivery. In the current release 1809, only the requester is
able to change his requisition using the App “My Purchase Requisitions”. Other
parties (approvers, purchasing department) can only change the follow-on document
in the backend system after the approval is finished or ask the requester to do a
change.
Links to the detail apps are provided within the displayed overview information or in
the tab “Related Objects” (display only):
The toolbar button “Open Task” is not available for requisition related approval steps
(due to a new technical foundation).
ASG External Active, if not Head Business role according to Complete Changes may trigger
1 executed on er ASG document (in workflow restart
PR levelif the User for role via MIAM backend
responsible interface transaction)
user is not
equal to the
buyer who
approved
the PR
ASG External Maintained Head Business role according to Complete Changes may trigger
2 in BRFplus er ASG document (in workflow restart
User for role via MIAM backend
interface transaction)
The details of the purchase order can be opened using the link “Open Task” in the
bottom toolbar:
After a change has been done, the updated order will be uploaded to the hub again
and the workflow will be restarted if relevant changes were made.
The following chapters are a walkthrough though the different apps and transactions
involved in the process from requisition creation to the finalized and approved order.
This includes the approval processing for both requisitions and orders.
Several apps are available for the creation of purchase requisitions: The employee
may use either the self-service (SSP) app or Ariba Guided Buying integration (see
chapter 3.3.2). The purchaser additionally has access to a professional requisition
management app as well as the classical SAPGUI transaction ME51N (delivered as a
webpage).
The following screenshots show the requisition creation process using the SSP app.
After logging on, the user starts the “Create Purchase Requisition” app:
The user will receive a notification on the company code and plant he is currently
assigned to and is able to add items to his cart:
In the next screen, the basic data of the item can be entered:
It is also possible to assign a fixed / preferred supplier and to add attachments and
notes:
After pressing “Add to Cart”, the overview in the upper right corner will be updated:
Back in the main screen, a summary of the cart is shown and the user can navigate
to the item again in order to change further details like organizational and account
assignment:
Finally, the cart can be ordered. If no error occurs, a purchase requisition will be
created in the hub:
If a workflow is configured in the system, the requisition will be sent into approval:
As already mentioned in the last chapter, several apps are available for the creation
of purchase requisitions: The employee may use either the self-service (SSP) app or
Ariba Guided Buying integration.
The following screenshots show the requisition creation process using the eBuy
(Ariba Guided Buying integration).
After logging into the S/4HANA Procurement HUB Fiori Launchpad, the user starts the
“eBuy” app:
Here the user has different options to create a PR (e.g. use catalog search or ad hoc
items).
After the user found the article he can add the item to the Shopping Cart.
After pressing “Add to Cart”, the overview in the upper right corner will be updated:
In the next step the user have to “check out” the shopping cart by clicking on “check
out”.
Here, a summary of the cart is shown and the user can navigate to the item again in
order to change further details like account assignment:
Here it is also possible to leave the supplier field empty for ad hoc items.
The possibility to transfer text ids & attachments from Ariba GB into the
Procurement HUB is not supported in the current release 1809 (should be available
with Release 1909). This means that the requester have to add notes, comments &
attachments while the PR approval workflow directly in procurement Hub in the
application “My Purchase Requistions” after the Ariba GB PR creation.
Finally, the Request can be created by clicking on “Send Request”. If no error occurs,
a purchase requisition will be created in the Ariba GB & Procurement Hub:
If a workflow is configured in the system, the requisition will be sent into approval
(HUB).
The status is in Ariba GB under “Your Requests” & in Procurement HUB under My
Purchase Requisitions visible.
Ariba GB:
Procurement HUB:
Approval of the requisition is done in the app “My Inbox” which displays all
workitems existing in the system. The specialized app “My Inbox – Approve Purchase
Requisitions” with a predefined filter on procurement workitems will not be used.
The app “My Inbox” can be opened using the corresponding tile. It also displays the
amount of open workitems the user is responsible for:
On the left side of the app, a list of all workitems will be shown, which can be sorted,
filtered and grouped, for example by task type:
On the right side, details on the currently selected workitem and the associated
business document will be displayed. In the bottom toolbar, the user can directly
approve or reject the workitem:
In the second tab, the user can add comments that are visible to all participants of
the workflow:
1) Attachments, which have been added within the workflow (can also be
deleted). These are only visible within the inbox.
2) Documents attached to the business object (for example by the requester).
These can be displayed here, but not changed.
The button “Show Log” can be used to display a log of past workflow activities:
If the user wants to display all details of the document or make changes, it can be
opened using the object link:
The upload of purchasing documents (purchase orders in this case) to the hub
system is usually scheduled as a periodic job by a system administrator. The
following app is provided for the necessary setup:
Purchase order approval is done within the central “My Inbox” app that collects all
open workitems of the user. For central purchase orders, no details are displayed in
the inbox at the moment. In order to check the document, the “Open Task” button is
provided (see chapter 3.2.3 for details).
MAHLE International GmbH,
Stuttgart
Project MORE
39
All other available functions are working in the same way as for purchase
requisitions.
There is no special action for the requester to cancel or recall a running workflow.
The user is able to delete his requisition or change it, which could trigger a workflow
restart according to the following restart criteria:
For release 1, the restart logic of SAP as described above will be used for both
purchase requisitions and purchase orders. An additional warning message on
possible workflow restarts is also not in scope for the first release.
During the pilot phase, the necessity of these extensions will be evaluated again.
This note should be optional in case of approval and mandatory in case of rejection.
For release 1: Rejection notes are not visible for the requester in release 1809. This
functionality will be part of the Release 1909.
The four-eyes principle will already be ensured by the approver determination rules
(based on the MAHLE signature guidelines). There is no need for the implementation
of special logic within the workflow to handle this case.
If the requester is determined as one of the responsible approvers of his own
document, the approval step will be skipped.
Although it is possible to adjust the mail text, no additional information from the
business document can be added at the moment (like price, item list). Therefore, a
custom mail will be implemented (see chapter 4.4.6 for details).
Approve 1 3 3 X ZREM_PR_1
PR
Approve 2 15 3 X X ZREM_PR_2
PR
Approve 1 3 3 X ZREM_PO_1
PO
Approve 2 15 3 X X ZREM_PO_2
PO
The feature “Deadline Monitoring” of SAP Business Workflow is not yet available for
the flexible workflow and does not provide the necessary flexibility (e.g. multiple
escalation levels and recipients).
In case of any errors (for example no approver was found in the determination), the
approval process will be stopped and log entries will be created (SWO1).
System administrator are able to use already known tools like transactions SWIA
and SWI2_DIAG to find and process erroneous workitems.
Furthermore, the workitem will be be forwarded to an admin which needs to be
maintained in a custom table. In addition to that, a mail will be send out to this
admin.
This mail should include the reason why the approver determination failed. It will
most likely because of one of the following reasons:
According to the current information, these rules will be maintained centrally using a
Fiori app and will be pushed to the Hub system. No additional actions need to be
taken for the Hub workflow.
The locally defined substitutes can be checked (and changed if the decision is to not
maintain them centrally) in the user menu while the “My Inbox” App is open:
There the ET_WORKLIST parameter can be checked. Within this MAHLE can look at
entries with WI_TYPE as ‘W’ (dialog workitems where someone has to approve).
These entries have all the required details e.g. approver, when the work item got
created, status & when it was approved.
Several points that were originally part of the concept’s first draft will be evaluated
again for the next releases. Please have a look at the outlook in chapter for details.
4 Solution Design
In the following chapters, you will find information on how the solution will be
implemented within the S4 procurement hub. This also includes information on the
required custom developments.
The Procurement Hub will also be used as the frontend server for all Fiori apps
(embedded gateway deployment) mentioned in this concept. This excludes the
app “My Inbox” which will run on the central MAHLE gateway system.
Later, the procurement hub apps may also be moved to the central gateway system.
The workflow logic itself would not be affected by this change.
The MIAM system (MAHLE Identity and Access Management) will be used as a data
source for user master and (extracts of) HR data, like manager and cost center
assignment. This information will be used as the central data source to find
approvers assigned to specific roles within the company.
Once the requisition is approved in the hub, it will be transferred to the
corresponding backend system, which could be either a SAP ERP or SAP S/4HANA
system (planned for later stages). Here the requisition(s) will be consolidated and
converted to purchase orders.
Next, the created ERP order will be blocked and uploaded to the hub for approval.
Once this is done, the ERP order will finally be released in both hub and backend and
sent to the supplier. In order to activate central purchase order approval,
additional settings are needed on ERP side that are described in chapter 4.3.6.
Advantage Stable and well-proven Well integrated into S4 Flexible flow-chart based
s tooling
Also used for other modules
(FI, SD, PLM) Can also be used for non-
SAP applications
Recommended procurement
workflow framework by SAP
Disadvant Necessary customizing Does not have the complete SCP license needed
ages can get very extensive feature set of other
No integration into S4
procurement solutions (e.g.
Our recommendation is to use the flexible workflow framework for the workflow
implementations in S4 (purchase requisition and central purchase order workflow),
because it provides most of the basic features required to implement a procurement
workflow in release 1809. Missing parts can be added as custom developments (see
the following chapters for details).
As the framework will be enhanced by SAP in the upcoming releases, some custom
extensions could be migrated to standard code later on.
Using the release strategy is no future-proof option, as there will be no new features
added by SAP and it may become obsolete in future S4 releases.
The cloud workflow would require extensive development work for integration into
the S4 procurement processes, because no content is delivered by SAP at the
moment.
For the implementation of the Procurement Hub, it was decided to use the flexible
workflow framework.
4.3 Customizing
The activation is stored in table T161 that is used to define document types for all
local purchasing documents (PRs, POs, RFQs and Contracts):
For central (uploaded) purchase orders, no customizing needs to be done in the hub
system. The workflow needs to be activated in the backend as described in chapter
4.3.6.
A scenario (= workflow template) defines the available start criteria and approver
determination rules, whereas a workflow is a concrete instance of such a template.
Each scenario needs to be activated before workflows can be configured in the
corresponding Fiori apps.
The following scenarios are delivered by SAP for purchase requisition and order
approval:
Scenario Description
Scenarios starting with WS9* are custom scenarios which are generated with a
sequential ID on creation.
In case a custom scenario was created (see chapter 4.4.1), the original SAP scenario
has to be deactivated in this table. Otherwise, the event linkage cannot be
deactivated permanently later on.
After starting the app relevant for the business document you want to process, all
customized workflows will be shown. If multiple scenarios are activated for the
document, make sure the correct scenario is selected in the drop-down:
Multiple workflows can be defined for a business document, which are evaluated in
the specified order. It is also possible to restrict the workflow execution on a specific
period. This can be useful to implement a smooth transition to a new workflow.
After providing name, description and validity period of the workflow, the start
criteria can be defined (the available values are defined by the scenario).
The workflow will only be activated when all the criteria are met. As only one central
workflow based on the ASG is used at MAHLE, the preconditions are not used on
workflow level.
In the area below the preconditions, the workflow steps are defined. An arbitrary
number of steps can be added, each with its own start conditions and approver
determination rule.
The approver (recipient) of a workflow step can either be assigned directly (SAP user
ID) or determined based on a rule as defined in the scenario.
As a rule can resolve to multiple approvers, it is also possible to specify whether only
one user of the set of possible approvers needs to decide on the document or all of
them. In the latter case, they all will receive a workitem in parallel and the step will
only be completed once all user have made a decision.
The maintenance of the step start conditions is identical to the one for the whole
workflow. Custom start conditions were added for each workflow step of the MAHLE
scenario. These conditions resolve to method calls later on.
Lastly, it can be specified how the workflow should cope with the rejection of the
specific step.
After all conditions and steps have been specified, the workflow can be saved and
activated. Please be aware, that a workflow cannot be changed after it was activated
once. In this case, a copy needs to be created.
SAP provides the Business Rule Framework Plus (BRFplus) for maintenance of custom
rules. This is a flexible alternative to storing and evaluating the necessary rule data
in custom tables.
As mentioned in note 2291465, BRFplus is the successor of BRF that is declared
obsolete with S/4HANA.
A function will be created in BRFplus for each approval step, which maps the
document data to the responsible SAP users and also checks whether a step should
be executed at all.
Example:
Various expression types like decision tables and trees, database lookups and
function calls can be used to maintain the rules:
The necessary expressions to access local as well as centrally provided data (MIAM
interface, see chapter 3.2.1) will be created and can be reused in several approval
steps. Simulation and tracing of business rules is also available as a feature of
BRFplus.
4.3.5 Automatic Creation of Purchase Orders for Requisitions from Hub (Backend)
The conversion of incoming hub requisitions into purchase orders can be done
automatically in the backend system under the following conditions:
- All mandatory data is present in the requirement (e.g. supplier and account
assignment)
- Flag “Automatic Purchase Order” is set in the vendor master record (in the
backend)
- The automatic order conversion was activated for hub requirements in the
following customizing node:
SAP delivers workflow templates and integration services for the central approval of
ERP respectively S/4HANA purchase orders within the Procurement Hub.
The following customizing is available on backend side to activate the central
purchase order approval:
- Document Type
- Purchasing Organization
- Purchasing Group
- Company Code
If a matching entry is found during creation of a purchase order, the status EKKO-
PROCSTAT is set to “26” (external approval) which triggers the central approval after
uploading the document to the hub.
In order to block the backend order until the approval is done, a dummy release
strategy has to be implemented for the relevant documents, which will be completed
after approval within the hub (see chapter 4.3.7 for details).
The start criteria for the release strategy has to be synchronized to the settings
made in customizing described above.
Create characteristics and a class, containing all relevant criteria to select the hub
orders (e.g. order type):
After the release strategy has been implemented, orders will be blocked as long as
the release in the hub is not done.
As the mail templates delivered with S/4HANA only support placeholders based on
flat structures, it was decided to use SO10 texts for storing custom mail templates.
With this solution, a higher flexibility regarding the mail content can be achieved
(e.g. generating item overview tables).
A class framework will be provided for using these mail templates. Common
functionality like sending the mail, generating logon links and doing basic
replacement will be provided by a base class. For each specific mail a dedicated mail
class will be derived which only provides special replacements and functionality on
top of the base classes implementation.
The workflow scenarios delivered by SAP only support a fixed set of start criteria and
approver determination rules. To extend these, a custom scenario can be created
and adjusted as needed. This scenario then replaces the SAP scenario at runtime.
This chapter describes the steps needed to create a custom scenario and attach it to
the business object (purchase requisition in this example). The process of adding
new start criteria and agent rules to the template is depicted in the following
chapters.
Start transaction SWDD_SCENARIO.
Open the source scenario, in this case WS00800157 (Header-based purchase
requisition approval):
The custom scenario will be displayed now and can be adjusted as needed:
The “comment mandatory” checkbox should be activated for the action “Reject”, so
that the approver is forced to provide a comment on why he is rejecting the
document:
In order to integrate the custom workflow scenario into the App “Manage Workflows
for Purchase Requisitions”, it needs to be added via Fiori Launchpad customizing
(client-specific, transaction FLPD_CUST) or configuration (cross-client, transaction
FLPD_CONF).
First, assign a transport request (optional):
Search for the “Manage Workflow” tiles in the “Purchasing Configuration” catalog:
The following chapters describe the necessary steps to implement additional start
criteria and agent determinations based on a generic customer field example. At
MAHLE, the checks and agent determination will be done based on the ASG rules.
First, the business object for purchase requisitions is extended to include a method
for checking whether a value is present in customer field of any item.
This is used to check, whether the ad-hoc step will be executed.
Start transaction SWO1 and create a new subtype for business object BUS2105001:
Final result:
Start transaction SWDD_SCENARIO, select the custom scenario and open the
flexible block:
Create new records in the tab “Conditions” (this is what is shown in the drop-down of
the configuration app later on):
Add one or more parameters, the user can fill in the app:
Connect the parameters with fields or functions of the business object by specifying
conditions:
Now the custom criteria can be used as preconditions in the Fiori App:
Update 14.03.2019:
As the workflow for central purchase orders is class-based, no classic business object
exists for which a subtype could be created.
Therefore, a different approach for implementing the custom start criteria was
chosen: A custom utility class was added to the workflow container that connects the
conditions of the workflow scenario to the workflow class framework. Please see
chapter 7.2.2.1 for technical details.
In order to have a common approach for all business documents, the purchase
requisition workflow was extended in the same way. No business object subtype was
created in the MAHLE system.
Please follow the steps below in order to add a new dedicated agent rule to a custom
workflow scenario. The benefit of this approach in comparison to using BADI
MMPUR_WORKFLOW_AGENTS_V2 is that it is possible to create a dedicated function
for each workflow step. This helps to determine which step is currently being
processed. The BADI only provides a list of the last approvers without any detailed
information on the current and past steps.
Start transaction SWDD_SCENARIO, open the custom workflow scenario and create
a new rule:
Add the rule to the agent rules of the flexible workflow block:
MAHLE International GmbH,
Stuttgart
Project MORE
74
Maintain the binding from the workflow container to the rule container (can be used
as “import parameters”):
Now the new agent rule can be selected in the “Manage Workflows” App:
In relation to the document’s workflow status some fields may have to be disabled
(not in scope for MAHLE release 1).
For the Fiori Apps this can be done using the extensibility options provided by the
App. Please refer to the documentation of the specific App for details:
https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/homePage
For UI adjustments in classical SAPGUI transactions, the available customizing and
the following BADIs can be used:
For the first release, it was decided to use the standard restart logic for both
purchase requisitions and orders.
Changes that are made within the workflow will be considered in the evaluation of
future workflow steps.
For example, when an ad-hoc approver is added to the customer field within the
workflow, the corresponding workflow step will be become active.
The fields which triggering a workflow restart for purchase requisitions are described
in the following note: https://launchpad.support.sap.com/#/notes/0002665086
The fields for evaluating the workflow restart are hard-coded without any extension
option via BADI or User Exit. An enhancement could be added to method
CL_MM_PUR_APPROVAL->CHECK_FOR_RESTART to implement customer logic.
Per default, any change to the purchase order in the backend that is uploaded to the
hub will trigger a workflow restart.
In order to mitigate this, an Enhancement will be created that checks the document
on relevant changes before restarting the workflow.
The sending of reminder and escalation mails on overdue approval steps will be
implemented as a custom report, which will be scheduled to run once a day. The
deadline-monitoring feature of the SAP Business Workflow is not available for the
flexible workflow framework in release 1809.
The workitem selection will be done based on the customizing table as described in
chapter 3.4.4.
The mail text will be defined as a mail template (see chapter 4.3.6 for details).
SAP provides a default mail template to notify users on workitems assigned to them:
As this mail lacks information on the document, it was decided to send the
notifications using a custom report. The workflow reminder report described in
chapter 4.4.5 already processes purchasing related workitems, so the notification
logic can also be integrated without causing much additional effort.
The info message as described below will not be implemented in the first release. A
re-evaluation will be done during the pilot phase.
SAP provides a set of BADIs to implement document checks and display of custom
warning / error messages:
As the “running workflow” message should be displayed for the requester, it will be
implemented in the first BADI. A drawback of the BADI is that it does not provide
information on the documents workflow status and no document ID that could be
used to read the required data.
Therefore, an enhancement was created at the end of method
CL_MMPUR_PUR_V_BADI_ITM_CHECK->MAP_BADI_FIELDS that stores the complete
item record for later use in the check:
When using a header-based workflow, all items are displayed to the approver in the
app “My Inbox”. In order to provide a better overview on the items he is responsible
for, the following extension could be applied:
- Create a new DB table for storing the responsibility on item level. The
following fields are needed:
o PR and item number
o User ID
o ID of the workflow step
- When determining the approvers in the workflow rules, the item-level
assignment needs to be stored in the table
- The management of the table entries should be done using a central class
which needs to be integrated into the approver determination of each
approval step
- Create a copy of CDS views C_PurRequisitionFs and C_PurRequisitionItemFs
and add a WHERE condition which filters out the items not relevant for the
approver based on the custom table described above
- Create a new OData service based on the custom CDS view in SEGW
- Activate OData service in /IWFND/MAINT_SERVICE on the gateway system
- Replace the OData service for task TS00800547 in SWFVISU with the custom
service
The described extension is only applied to the app “My Inbox”. It does not filter any
items in the “Manage PR” apps or the classical SAPGUI transactions like ME52N.
Prerequisite for taking over most of the hub developments into the S4 template is
that the template is also based on release S4 1809 (or later).
Most of the workflow logic is independent from the deployed scenario (S4
procurement hub vs. S4 standalone) so most of the custom developments can be
reused, too.
An exception is the PO workflow, which is utilizing different workflow scenarios in
Hub (WS00800333) and Standalone (WS00800238) deployment. Nevertheless, it is
recommend to maintain all adjustments to the workflow scenarios centrally in the
hub system (see general approach below).
The following approach is recommend to reuse as much code as possible between
the hub and template system:
The following Enhancements were rejected by the Governance Board for the first
release and will be re-evaluated during the pilot phase:
6 Impact Estimation
6.1 Global Template
6.3 Testing
Test cases:
7 Implementation Details
7.1 Customizing
In transaction SWU3, the prefix for custom workflow templates was maintained:
This prefix will be applied to all custom workflow scenarios and only has to be set
once in the development system.
The scenario-based workflow was activated for the following business document
types:
Purchase YAR (via hub customizing as described in
Requisition 4.3.1)
Both custom workflow scenarios have been activated as described in chapter 4.3.2:
- NW_APS_BPM_LIB
- NW_APS_BPM_SWE
- FDT_WD_WORKBENCH (Maintenance of BRFplus rules)
- CA_FIORI_INBOX (App “My Inbox”)
- SWF_FLEX_SCENARIO_SRV
- /IWPGW/TASKPROCESSING
The custom workflow scenarios were added to the selection of the “Manage
workflows for …” apps as follows:
- Add the corresponding custom scenario to the parameter list of the navigation
The available actions (Approve, Reject) were configured for the tasks of the custom
scenarios:
Name Description
The objects relevant for ongoing maintenance (decision tables) are described in the
following chapters. For easier access, they have been added to the catalog view
ASG_CATALOG, which hides all other objects:
The usage of a decision table is similar to a customizing table with the following
major differences:
- Entries are evaluated from top to bottom and the first match is returned. This
means the list has to be sorted from specific to generic entries with the most
generic record being at the end.
- Excel import and export is supported out of the box
- Simulation is possible (check which record will be returned for an specific
input)
For the first release, a local representation of the Approval and Signature Guidelines
(ASG) was created as a decision table.
In the first columns, the document data is specified which should be checked for a
match:
At the end of the table, the needed business roles are maintained for all approval
steps:
The table is used to find the necessary business roles for approval based on the
document’s data (valid for both PR and CPO).
If no value is maintained in one of the business role columns, this means that the
corresponding workflow step will be skipped.
All changes to the table will be recorded in a standard customizing request.
As long as the MIAM interface is not in place, the assignment of users to business
roles is done within the hub in decision table ASG_APPROVER.
Higher codes include the authority to approve for lower code. For example, if code
700 is assigned to a user he is also authorized to approve code 500.
Maintenance of the table can be done locally without a transport request.
Decision table ASG_OPTIONAL can be used to activate optional workflow steps within
the PR and CPO workflow for special cases. In this table, the user IDs are assigned
directly (not via business role codes).
Each of the OPTIONAL_APPROVER_* columns corresponds to a specific optional step
within the PR / CPO workflow (see chapter 3.2 for an overview) where additional
approvers can be inserted.
In this table, it is possible to add multiple rows with the same criteria in order to add
multiple optional approvers.
Maintenance of the table can be done locally without a transport request.
This decision table is also executed within the approver determination and can be
used to overwrite the approver returned by MIAM (resp. the local approver determed
based on ASG_APPROVER in release 1) for special processes.
In the first columns, the document data has to be specified on which the exception
has to be applied:
In the next fields, the business role that should be replaced along with the target
approver needs to be specified:
The frequency and text of workflow notification and reminder mails can be
configured in table /MAHLE/0355_0001:
The mail text can be freely created using HTML for formatting. IDs enclosed in &&
are used as placeholders and will be replaced by the runtime class specified in the
customizing table mentioned above.
There are some generic IDs that can be used for any mail and document-specific IDs,
which are defined by the runtime class.
LOGON_LINK Generate a link to the App “My Inbox” (or another target by overwriting
GET_LOGON_LINK in the runtime class)
In addition, any public (read-only) attribute of the runtime class can be used as a
document-specific ID.
Example for PRs:
7.2 Development
One of the main targets of the implementation was efficient sharing of common code
between workflow steps and providing a clean interface to integrate the custom code
into the flexible workflow framework. In order to achieve this, several class
frameworks were implemented which are described in more detail in the following
chapters. Shared logic is implemented in the general or document-specific base class
and only step specific details need to be implemented or overwritten by the workflow
step implementations.
A class framework has been implemented to build the foundation of all workflow
steps. The basic idea is, to provide a dedicated class per workflow step, which
inherits document-specific and generic code from special base classes. This way,
code can be reused effectively.
Basic structure of a workflow step class that is the central point for all logic related to
this specific step:
Some additional development objects are needed to integrate the workflow step
class into the workflow scenario as defined in transaction SWDD_SCENARIO.
Overview on the main classes of the framework:
The general process flow for checking a workflow step’s start conditions and
approver determination are depicted in the following charts.
Figure 6 - Process flow for checking start criteria on the example of “Internal Approval #1”
Figure 7 - Process flow for approver determination on the example of “Internal Approval
#1”
The basic structure is similar to the one of the workflow framework. The common
base class representing any kind of mail is extended by business document specific
subclasses. Finally, a specialized class is created for each specific mail.
Program /MAHLE/0355_WFL_NOTIFICATIONS has to be scheduled to run once a
day as a job to collect all overdue workitems and send the appropriate mails.
A custom workflow scenario was created for PR and PO approval based on the
following SAP templates in transaction SWDD_SCENARIO:
SAP Custom
Template Template
Most of the logic for implementing a flexible workflow is generated from the flexible
block:
This includes the start criteria available in the “Manage Workflows for …” apps
(custom ones are highlighted):
Both extension points are described in more detail in the following chapters.
The main reason why custom start criteria are needed are special circumstances that
require a workflow step to be skipped. For example:
Both criteria cannot be covered using SAP start conditions. Just returning an empty
approver list during approver determination is also not sufficient to skip a step, as
this will result in a workflow error.
In order to call the main workflow step class when executing a start condition check,
a special utility class was created and added to the program exists of the workflow
scenarios:
The utility class is called to fill a special structure in the scenario’s workflow
container that stores the activation status of each step:
Finally, the condition value of the structure is connected to the start condition as
defined in the flexible block:
Internally, the utility class forwards the call to the main workflow class:
Custom approver determination rules are necessary because the BADI provided by
SAP makes it hard to determine which workflow step is currently being processed.
The same BADI implementation is called for every step. A list of previous approvers
is provided as a guide, but this can be difficult to interpret especially when
substitutes are involved in the approval process.
The integration between the approver determination of the workflow scenario and
the workflow class is provided by rules. These rules can be access via the menu
within SWDD_SCENARIO:
The rule calls a function module, which in turn forwards the call to the workflow step
class:
Business rules are maintained in transaction BRF+ and are executed in order to
determine if a step should be executed and who is assigned as the responsible
approver.
Several rules, calculations and decision tables are involved in the approver
determination. An example is shown in the following picture:
Figure 10 - Rough flow of the business rule execution for the workflow step “Internal
Approval #1”
Some additional classes provide utility functions that can be used by all workflow
steps.
Class Description
7.3 Miscellaneous
BRFplus provides the possibility to create a trace for all steps of rule evaluation. In
order to activate the trace for a specific user as needed, a new user parameter was
created:
This way, tracing can be activated on user level and without decreasing the
performance for other users:
8 Related Documents