cancel
Showing results for 
Search instead for 
Did you mean: 

How to Stop a workflow step

vikash_pathak
Participant
0 Kudos

Hello ,

I have a requirement in which i have created one step in workflow and ABAP class and method is used,

and these step will call a method which has logic to fetch data from custom table

if data is found have to return success message

if data not found , error message has to return and stop the pipeline and next time from that specific step where it had failed have to retrigger.

Please let me know how to fail workflow step on no data found and how can i reprocess it again .

Triggering workflow and retrigger the step all have to be done through ABAP Report that user can reprocess on getting return error message.

Thanks

Sandra_Rossi
Active Contributor

I don't know what exactly does your ABAP report, but what you ask looks like a workflow step of type "user decision" (like title "Error no data found" click button "Continue"). That would simplify a lot your custom code. Can you explain why you don't want to do that?

If your error should be an exception, I would advise to make the workflow fail with a logical error, and make it recover by administrator (transaction code SWPR). Eventually your "ABAP Report" may start SWPR in this particular case (via SAP_WAPI_ADM_WORKFLOW_RESTART).

Accepted Solutions (1)

Accepted Solutions (1)

bpawanchand
Active Contributor

You should do few things both from class as well as workflow. which I have captured in the below screen shot. You should be able to achieve what you are expecting

vikash_pathak
Participant
0 Kudos

Hello Pavan,

Thanks for your help,

I followed the steps as you described, but i stuck at the Outcome option.

i am getting only two option at outcome tab, there is no option to add any even for exception, check the images attached

let me know if i missed anything.

Thanks

bpawanchand
Active Contributor
0 Kudos

you need to add an exception in the method of the class which you are using in the task then you will see this as a part of outcomestab

vikash_pathak
Participant
0 Kudos

Hello Pavan,

I have added exception in calling method you can check in image attached

bpawanchand
Active Contributor
0 Kudos

In my case when I designed the task I made the task as background task in your screen shot I see that the image is a foreground or a dialog task. in this case I guess it might not work. I need to check. However, in the mean time can you check by refreshing the buffer SWU_OBUF transaction and click shift+f1 to refresh and again reopen the worklfow if in case you added this exception after my suggestion.

vikash_pathak
Participant
0 Kudos

Hi Pavan,

As you said i refreshed and its reflecting now even without background processing enabled,

now one question , as i am triggering this workflow from ABAP Report program , if workflow reach to the wait step , do i need to call another report for further action? or do we have option to accesses same thin from one report itself.

if i trigger workflow from ABAP report and as soon as it reach to WAIT step can i get the response within same report and allow to to rexecute the previous step again ?

Answers (0)