In SAP S/4HANA On-Premise 2021 release, SAP introduced the phase model for maintenance process. You can see
this blog for details of phase model. One of the phase in the 9-step phase model is 'Cost Approval Work Order' phase.
Phase model for maintenance process
Work Order cost approval uses 'Flexible Workflow', which is an extension of the Business Workflow. Please go through SAP help on '
Flexible Workflow' for further details. This blog explains the configuration steps to enable the flexible workflow for cost approval of maintenance orders.
1. Check configuration of Business Workflow / Flex Workflow
Go to
SPRO - SAP Customizing Implementation Guide - ABAP Platform - Application Server - Business Management - SAP Business Workflow - Maintain Standard Settings
Configuration of Flexible Workflow
This customizing activity has the following areas
- Runtime Environment
- Definition Environment
- Additional Settings and Services
- Classify Tasks as General
If you have configured workflow functionality (SAP Business Workflow or Flexible Workflow) in your system already, all Customizing steps listed in this step should have a green checkmark. If not, click Redo Automatic Customizing to complete this activity. You could select individual activities under each area and click Execute Activity to make the required settings. If you have not used any workflow before you need to click Automatic Workflow Customizing to make the settings.
For more info on Automatic Workflow Customizing please see
SAP help.
2. Activate the workflow scenario
You need to activate the workflow scenario
'WS02000019' in the client.
WS02000019 is the SAP pre-delivered workflow scenario for Cost Approval of Maintenance Order.
Run the transaction SWF_PROCESS_ADMIN in the backend. Switch to change mode and then activate it.
Activating the workflow
Alternatively, Go to
SPRO - SAP Customizing Implementation Guide - ABAP Platform - Application Server - Business Management - SAP Business Workflow - Flexible Workflow - Scenario Activation and Search for the workflow scenario WS02000019.
If the scenario is already in the list, simply set the
Active flag, if not create a
New Entry and set the
Active flag.
Workflow Scenario Activation
Check:
Check if the service call for the scenarios succeeds:
http://url:port/sap/opu/odata/sap/SWF_FLEX_DEF_SRV/Scenarios
In the response, you should see the scenario id WS02000019.
3. Maintain Scenario Definition
You have to define the scenario to be consumed by the Task Gateway service and assign atleast one Consumer Type for the scenario definition.
Go to
SPRO - SAP Customizing Implementation Guide - ABAP Platform - Application Server - SAP Gateway Service Enablement - Content - Task Gateway - Task Gateway Service - Scenario Definition
Make an entry as shown in the below figure:
Scenario Definition
You can get the Task Id (TS02000040) from the Workflow (SWDD_SCENARIO) WS0200019. Please see the below figure:
Task Id in the Workflow Scenario
4. Maintain Task Names and Decision Options to be used in the Fiori app 'My Inbox'
In this configuration step, define the task name and the decision options. The workflow supports two decisions - Approve and Reject.
Go to
SPRO - SAP Customizing Implementation Guide - ABAP Platform - Application Server - SAP Gateway Service Enablement - Content - Workflow Settings - Maintain Task Names and Decision Options
Make an entry as shown in the below figure:
Configure Step Name
Configure Decision Keys
4. Configure Fiori app 'Manage Workflows for Maintenance Orders' in the frontend server
Use the transaction
/iwfnd/maint_Service to activate the OData Services to be consumed by the app:
- Generic Service for Flex workflow (SWF_FLEX_DEF_SRV)
- Service for the Value Helps in the Manage Workflow App (S_EAM_WF_C_VH_CDS)
- Service for the maintenance order workflow (EAM_MAINTORDER_WORKFLOW_SRV)
For more information about activating OData services, see
Activating OData Services
5. Activate the SAPUI5 Application for Workflow editing
Use the transaction 'SICF' in the frontend server and activate the UI5 app /sap/bc/ui5_ui5/sap/nw_aps_bpm_swe.
6. Activate the Business Feature 'EAM_PHASE_MODEL_PROCESSING'
Approval of the work order is one of the step of the 'Active Phase Model' of the maintenance process. To enable the 'Active Phase Model' for a maintenance order, activate the business feature 'EAM_PHASE_MODEL_PROCESSING' in SPRO.
Go to
SPRO - SAP Customizing Implementation Guide - ABAP Platform - Application Server - Business Management - SAP Business Feature - Activate Business Feature and activate the business feature.
Business feature activation
7. Set 'Active Phase Model' flag in the maintenance order type to 'True'
Now in the backend server, you have to specify the order types that follow the 'Active Phase Model' maintenance process. For this, you have to set the 'Active Phase Model' flag in the order type to 'Yes'.
Go to
SPRO - SAP Customizing Implementation Guide - Plant Maintenance and Customer Service - Maintenance and Service Processing - Maintenance and Service Orders - Functions and Settings for Order Types - Configure Order Types. Select the order type and set the flag as 'Active Phase Model'.
8. Enable the phase model for the order type
As stated at the beginning of the blog, system triggers flexible workflow only when the order follows phase model. To adopt the phase model for a maintenance order type, you need to assign 'Overall Status Profile' to the maintenance order type.
Go to
SPRO --> Plant Maintenance and Customer Service -> Maintenance and Service Processing --> Fiori Apps for Maintenance Processing->General Settings --> Configure Overall Status Profile --> Assign Overall Status Profile for Order Types
Caution: Use the SAP delivered Overall Status Profile 'PMSP1', unless you are confident on your own 'Overall Status Profile'. Otherwise, it is advisable to stick to SAP delivered 'Overall Status Profile'.
Caution: Once you enable the phase model for an order type, then it is applicable for all the planning plants.
9. Enable workflow for your plant and order type
You may not need approval for every maintenance order. For example, in your plant, emergency maintenance orders do not need any approval. Decide which order types in your plant require cost approval and mark only those order types as cost approval relevant.
Go to
SPRO - SAP Customizing Implementation Guide - Plant Maintenance and Customer Service - Maintenance and Service Processing - Maintenance and Service Orders - Functions and Settings for Order Types - Define Approval Settings for Maintenance Orders
You will see the list of order types for every planning plant. Set the flag Appr Reqd =
Yes, if cost approval is required for the work order.
Approval configuration for plant and order type combination
10. Configure Flexible Workflow rule
You can use the Fiori app F4989 (Manage Workflows for Maintenance Orders) to define condition-based workflows for approval processes.
Key takeaways:
- Configure the workflow scenario WS02000019 and task id TS02000040
- Activate the services and the Fiori app in the frontend server
- Configure the approval for the order type
Hope this blog is helpful. Please post your questions and comments. Will try my best to produce more blogs on how to define an approval rule and setup teams and responsibilities for the approval process.