Flexible workflow for Maintenance Order

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%20model%20for%20maintenance%20process

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 whether Business Workflow / Flex Workflow is configured in your system

Go to SPRO – SAP Customizing Implementation Guide – ABAP Platform – Application Server – Business Management – SAP Business Workflow – Maintain Standard Settings

Configuration%20of%20Flexible%20Workflow

Configuration of Flexible Workflow

All the customizing steps here should have green tick. If not, contact your administrator to setup the Business Workflow / Flexible Workflow in your system.

For further details, please refer the SAP help documentation for Business Workflow:

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%20the%20workflow

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%20Scenario%20Activation

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%20Definition

Scenario Definition

Assign%20Consumer%20Types

Task%20Definition%20for%20the%20Scenario

You can get the Task Id from the Workflow (SWDD_SCENARIO) WS0200019. Please see the below figure:

Task%20Id%20in%20the%20Workflow%20Scenario

Task Id in the Workflow Scenario

4. Maintain Task Names and Decision Options

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%20Step%20Name

Configure Step Name

Configure%20Decision%20Keys

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%20feature%20activtion

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’.

Maintenance%20Order%20Type%20Configuration

8. 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%20configuration%20for%20plant%20and%20order%20type%20combination

Approval configuration for plant and order type combination

9. 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
  • Activate the services and the Fiori app in the frontend server
  • Configure the approval for the order type

I hope this blog is helpful. Please post your questions and comments. I will try my best to come up with more blogs on how to define an approval rule and setup teams and responsibilities for the approval process.