cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow error handling

0 Kudos

Hi Workflow experts,

We have a custom FIORI request approval application and needs to track down the error requests seperately.

For that, We are creating 'Workflow system error monitoring report'. Basically the core requirement is, when error occurs like Email ID missing, Agent not determined, method cannot be executed,TRFC connectivity issue, dump issue Or network issue, these issues should be updated as 'System error' in that monitoring report. After displaying the error entries into report, Our IT local team will have an authority to resolve that and redirect to corresponding approval by using button.

Point 1. For tracking the workflow error, we can run a report in background every 2 min for tracking workflow error request and update into monitoring report. Will this be good idea to follow this process?

Point 2. Is it feasible to redirect to previous/ next approval once system error resolved?. Actually once workflow gets into error we are having feature to re trigger from SWPR/SWPC tcode that will help to continue the flow from where it got struck and not help to redirect to previous/next approval. In this case, how to achieve this? Kindly provide your expertise on this. Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

pokrakam
Active Contributor

Let me put it a different way:

What is more efficient: Scanning for a status every 2 minutes or reading it when you need the information?

If you're writing code to duplicate workflow statuses and trying to model system errors I would suggest rethinking your approach.

System errors should be rare, any expected errors should be modelled if you have specific requirements on how to handle those. So something like: determine agent -> if fail, route to someone else to correct and approve.

0 Kudos

Hi Mike,

Yes. Expected errors can be modeled. But the connectivity issue/ Saperion issue/dump issue need to handle in my requirement. Hence i will put in this way as below.

Point 1 : Let's say there is a workflow template 'WS1234567'. Whenever it gives system error like dump(ST22) or tRFC (SM58) connectivity issue, I need to update a custom table for a corresponding request with status as 'System error'. How it can be achieved without developing a report and running in background? Is there any better way to handle this requirement?

Point 2 : Please suggest me if there is any feasibility to apply my custom code whenever workflow occurs into Error status?. Thanks.

pokrakam
Active Contributor

I've been building custom workflows for well over 10 years and have never replicated a workflow status into another table. Data modelling 101. Rather focus your efforts in building a robust application that minimizes failure.

Workflow errors should be technical in nature and for exceptional situations that should be handled centrally. SAP already provide you the tools you need: ST22, mails to the WF administrator, SWI2_DIAG, SM58, Solution Manager, CCMS, etc.

Why write a report that duplicates all that? How are you planning to catch all these scenarios? Remember your WF won't go into error in many scenarios. And think about the test effort. Just make sure you have processes in place for dealing with these situations for all applications, not just for one.

To 2: Pushing a status to the application is always a bad idea. You can read the WF status when needed and publish that in your application. There are many ways to recover a failed workflow, how will you deal with resetting the status in each case?

Good luck.

pokrakam
Active Contributor

To Point 1: No I don't think it's a good idea. SAP already provide good error monitoring capabilities, why do you want to redevelop the same thing?

To Point 2: Model this in your process, that's what workflow is for!

0 Kudos

Hi Mike,

Thanks for your response.

Point 1 : Yes. There are error monitoring program to restart from error state. But, My UI5 application is a custom app which has custom table and fields. This has to be updated for respective requests which particularly goes into error. For every error request, my custom table has to be updated with 'Error status'.

Point 2 : Yes. If workflow gets system error, where do we have to apply our custom logic program?. Basically if workflow gets into error, even if we resolve the error, we can't redirect the same error workflow to previous /next level approval rite because the status will be 'Error... (Or else), Is it possible to trigger an event when error occurs right away?. So that with an error event triggering we can write custom logic to redirect the approval process? Please correct me if i am wrong. Thanks.

anjan_paul
Active Contributor
0 Kudos

Hi,

You can also take help of the fm SWP_WORKFLOW_LOG_READ read workflow log.

Thanks