Skip to Content
Product Information
Author's profile photo Venkata Uma Nageshwara Sharma Manda

Flexible workflow for Maintenance Order (Private Cloud Edition)

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 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%20of%20Flexible%20Workflow

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%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 (TS02000040) 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 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%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.

For more information about how to activate the ICF service, see Activate ICF Services of SAPUI5 Application.

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

Assigning%20Overall%20Status%20Profile%20to%20Order%20Type

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

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.

Assigned Tags

      11 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Rajendra Pandey
      Rajendra Pandey

      Hi Venkata,

      Thanks for great blog-post. It was really helpful

      Warm Regards,

      Rajendra

      Author's profile photo Javier Guzman
      Javier Guzman

      HI Venkata

      Thanks for great blog too. but I wanted include that to activate the process, it is necessary to configure the type of order that you want to include in the submission process in the following route.

      Plant Maintenance and Customer Service->Maintenance and Service Processing-> Fiori Apps for Maintenance Processing->General Settings

      Best Regards

      Javier

       

      Author's profile photo Kannan Thangavel
      Kannan Thangavel

      Hi Javier

      can you please share the steps to configure General settings part it will be grateful

       

      Regards

      Kannan Thangavel

      Author's profile photo Javier Guzman
      Javier Guzman

      Hi Kannan

      In the following IMG route, we need include order type that require apply for approval.

      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

      and include Order type and Ovrl sts profile PMSP1

       

      Regards

      Javier Guzman

      Author's profile photo Venkata Uma Nageshwara Sharma Manda
      Venkata Uma Nageshwara Sharma Manda
      Blog Post Author

      Hi Javier,

      You are absolutely correct. I will add this to my blog.

      Regards,

      Nagesh

      Author's profile photo Saurav Maria
      Saurav Maria

      Hi Nagesh,

       

      Great overview. Can we configure various parameters based on Plan Cost , Mtce Plant & Plant Section combination to trigger workflow for approval or not? 

       

      Regards,

      Saurav

      Author's profile photo Venkata Uma Nageshwara Sharma Manda
      Venkata Uma Nageshwara Sharma Manda
      Blog Post Author

      Hi Saurav,

      Yes, it is possible in Flexible Workflow.

      Regards,

      Nagesh

      Author's profile photo Yogesh Sharma
      Yogesh Sharma

      Hi Venkata,

       

      Very nice blog. Can you please confirm few things :-

      1.  After activating workflow, Maintain Task Names and Decision Options is used only for giving approval option for Inbox? Is this step mandatory.
      2.  Even after deactivating workflow from Manage Workflows for Maintenance Orders app order is going for approval. Is it going because of the tick mark already activated in "Define Approval Settings for Maintenance Orders" settings for YA01 and YA02.
      3. We can restrict workflows according to order types inside the steps too in the app and there is a setting also in Define Approval Settings for Maintenance Orders" settings for YA01 and YA02. How both are different?

      Regards
      Yogesh Sharma

      Author's profile photo Venkata Uma Nageshwara Sharma Manda
      Venkata Uma Nageshwara Sharma Manda
      Blog Post Author

      Hi Yogesh,

      Please see the answers below:

      • After activating workflow, Maintain Task Names and Decision Options is used only for giving approval option for Inbox? Is this step mandatory.
        • Yes, this is mandatory. When you submit a work order for approval, it creates a task in the Inbox. The decisions options appear in the workflow task.
      • Even after deactivating workflow from Manage Workflows for Maintenance Orders app order is going for approval. Is it going because of the tick mark already activated in "Define Approval Settings for Maintenance Orders" settings for YA01 and YA02.
        • Thanks for pointing out this. You are correct. Since, the order types are marked for approval, system is triggering the workflow.
      • We can restrict workflows according to order types inside the steps too in the app and there is a setting also in Define Approval Settings for Maintenance Orders" settings for YA01 and YA02. How both are different?
        • I am not sure whether I understood your question correct. I think you are referring to exempting the order types in the steps of the workflow rule. If it is the case, then here is the explanation:
          • System evaluates whether an approval is required or not based on "Define Approval Settings for Maintenance Orders"
          • If an approval is required, then it evaluates the workflow rules set up using "Configure Workflow for Maintenance Order" app. If the system doesn't find any workflow rule, then the last rule which is the default rule (containing auto-approval) is triggered. This will set the maintenance order to "Approved".
          • If an approval is not required for the order type, then the system will release the work order and no approval is required.
      Author's profile photo Flavio MORGANTE
      Flavio MORGANTE

      Hello all,

       

      Someone could help me please ? Everything is configured as best practice in my system.

      I also defined an HR master data and I linked it to my user. Nevertheless, I don't find any user when I try to assign my user as recipient of this workflow.

      Someone can help ?

      Thanks

      Author's profile photo Jon Goicoechea
      Jon Goicoechea

      Hi Venkata,

      Thank you so much for all this information. Very helpful.

      Is it correct that the Manage Workflows for Maintenance Orders Fiori app is not present for On Premise? Meaning we have not the option for On Premise to manage this cost approval workflows?

      Thank you,

      Jon