Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 
Hello everyone! As this is my first blog, let me introduce myself! 🙂
I am Tatiana Coelho from SAP Support team. I have been working at SAP since 2017, first with Supplier Relationship Management (SRM) Team and then moved to the S/4HANA Procurement (MM) team.

I have been working with Flexible Workflow for some years, and the analysis is quite the same in most cases. Therefore, I decided to write this blog to empower customers in solving common issues related to this functionality. On this blog, I am going to focus on purchasing scenarios in OnPremise systems. But some steps may also be useful for other scenarios (just adapt them to your needs 🙂 ).

Flexible Workflow adoption is growing with each release due to the new features provided, which allow customers to define approval processes closer to their needs. This functionality involves many settings that must be in place to work properly. Otherwise, you might face some issues during approval.

If you are new to this subject, I recommend that you start here:
SAP S/4HANA Flexible Workflow Overview and Comparison with SAP Business Workflow
Flexible Workflow Steps
Documents Supporting the Flexible Workflow

#Step 1:
Make sure that SWU3 is maintained correctly:

The approval process will not be triggered unless the 'Edit Runtime Environment' node is green. This node ensures that all generic workflow settings are in place so that the application can trigger the workflow event. You can find more details about this in KBA 2366252 - Transaction SWU3 explained.

Also ensure that the relevant task is set to 'General task'. See KBA 3135239 - Flexible workflow started but unexpected behavior found (eg. work item cannot be found in ... for more details. This will avoid some issues that may occur after the approval is triggered.

#Step 2: 
Maintain the SAP_WFRT user as explained in SAP Note 2568271 - Change of workflow system user and workflow system jobs with S/4HANA On-Premise 1709. After reproducing the issue, you can also check in SU53 transaction if there are any authorization issues for this user.

#Step 3: 
The affected workflow scenario must be active in SPRO transaction:

In this link, you can find the relevant workflow scenario for each purchasing document: Workflow Scenarios and Tasks.

#Step 4: 
The workflow will be triggered based on the scenarios and conditions defined in the Manage Workflows app. You can use a unique app (e.g. Manage Workflows app) for all workflows scenarios or a separate app for each purchasing document (e.g. Manage Workflows for Purchase Contracts app).

You can define as many scenarios as you want based on your needs, but it is recommended that Automatic Approval remains active so that it is used as a last resource.

In SWF_PROCESS_VIEW transaction, you can view all the scenarios defined for each workflow and mainly confirm whether it is active. If it is shown as inactive, double-check the previous steps.

#Step 5: 
In SPRO / OLME transaction, make sure that the Flexible Workflow is active for the relevant document types. The path is usually: OLME transaction > *Purchasing document* > Flexible Workflow for *Purchasing document* > Activate Flexible Workflow for *Purchasing document*. Let's take the purchase contract as an example:

In this case, the Flexible Workflow is active for document types WK and ZSC.

#Step 6: 
After the document is created, depending on the purchasing document, you can find the approval details either in the corresponding back-end transaction or in the relevant Fiori app. You should also see the approval status, which indicates whether the workflow have been triggered successfully.

If the approval details are missing, or the approval status is incorrect, the best place to find errors is in the work item log. To find the work item, execute the following steps:

  1. Run SE16/SE16N transaction

  2. Enter table name SWWFLEXPROC

  3. Enter the document number in the Instance ID field

  4. Execute

If a work item is found, copy the work item ID (see example below) and go to step 7. Otherwise, go to step 8.

#Step 7: 
To see the work item log, go to SWI1 / SWIA transaction and enter the work item ID, then click on List with technical details. In the Step history tab, you will find errors if any (check all steps to make sure you did not miss anything).

Here you can find several different errors, like agent determination failed, locking issues, accounting issues, etc.

#Step 8: 
When no work item is found, capturing an event trace helps you understand why it was not created. KBA 1709418 - How to use the Event Trace for troubleshooting explains how to capture and analyze this trace.

#Step 9: 
If all settings are correct, the work item is found and there are no errors in the step history, but still the approval status is not updated correctly, check SM13 transaction. Some errors can occur after the work item is executed, which can be found there (this issue may occur for different reasons, but the most common cause is due to output-related errors).

In SM13, enter SAP_WFRT in the User field and adjust the period based on when the document was updated/created. If any entry exists, double-click on it to see the details (see example below):

I hope this blog helps you find and solve Flexible Workflow issues more easily. You are welcome to post any questions / feedback you may have in the Comments section.

See you on the next blog! 🙂

Best regards,

Tatiana Coelho

S/4HANA Procurement