ABAP OO application exception and passing parameters back tow orkflow container

Dart, Jocelyn jocelyn.dart at sap.com
Sun Feb 24 16:29:11 EST 2008


Hi Dave, 
 
This is one of those topics I meant to get around to doing a blog on SDN but in the meantime what you need to do is....
 
1. Firstly make sure you understand the difference between an exception - which does NOT (under any circumstances) pass data back - and never did even with BOR  - and export parameters, which do.  For your situation you might find it more useful to use stick with your export parameters - similar to how many of the update BAPIs work.   You can have a class which supports both exceptions and export parameters, but if you raise an exception you cannot pass back export parameters at the same time - e.g. you might use export parameters for known business process errors, and exceptions for unexpected errors. 
 
2. You can use Exception Classes similar to using exceptions in BOR - i.e. to indicate whether the step should be retried (up to max number of retries) or reported immediately to the workflow administrator.  E.g. to create an exception for a locking problem where the step can be retried, create an exception class with parent class CX_BO_TEMPORARY. 
 
3. You can pass variables to the Exception Class for troubleshooting.  All you need to do is create extra attributes of your exception class - this will then automatically allow you to pass the variables when raising the exception class.  You then need to expose the variables to the workflow log - e.g. by using placeholders in the exception text. 
 
 
Hope that helps. 
 
Regards,
Jocelyn 
 
 

________________________________

From: sap-wug-bounces at mit.edu on behalf of Dave Weston
Sent: Fri 22/02/2008 2:07 AM
To: SAP Workflow Users' Group
Subject: RE: ABAP OO application exception and passing parameters back tow orkflow container



Hi Florin, 

I am using a workflow task based on an OO method in a class, so am not using swc_set_element (no BOR). But I guess I could return a result value and check that in the workflow. Seems a bit limited though. If I run the method in SE24 and the exception is raised the exporting parameters are returned, but not in the workflow. One thing i could try is fill the binding from the method to task container and see if it makes any difference. If not I'll go the result way I guess.

Dave 


-----Original Message----- 
From: sap-wug-bounces at mit.edu on behalf of Florin Wach 
Sent: Thu 2/21/2008 5:57 AM 
To: SAP Workflow Users' Group 
Subject: Re: ABAP OO application exception and passing parameters back toworkflow       container 
  
Hi Dave, 

the data flow is aborted on an exception. Only the message variables (sy-msgv1,..v4) and the exception number is passed back.


---> follow-up: 

If you want to have a workflow activity with more outcoming threads (like you have it in the generic user decision steps), you could use the following:

- Double click on the object's method 
- Choose tab "Result type" 
- Give a reference to a field here, that again refers to a domain with fixed values, e.g. 
  SE Step executed 
  X1 Exception 1 
  .... 
  (I think there's a restriction to 4 characters as the key) 
- In the object's method implementation use the macros to set the result 
  swc_set_element container RESULT 'SE'. 
  swc_set_element container RESULT 'X1'. 

This way you'll have a dataflow. 

Best wishes, 
Florin 

-------- Original-Nachricht -------- 
> Datum: Wed, 20 Feb 2008 20:04:15 -0500 
> Von: "Dave Weston" <Dave.Weston at clockwork.ca> 
> An: sap-wug at mit.edu 
> Betreff: ABAP OO application exception and passing parameters back to workflow        container 

> Hi folks, 
> 
> I am raising an application error in an OO method in my workflow and 
> filling some export parameters (which would normally get passed back to the wf 
> container when no exception is raised). When the class exception is raised 
> the filled parameters are not passed back to the wf container. 
> 
> Has anybody implemented an application exception that when raised passes 
> export parameters back to the task and wf container ? 
> Was wondering if creating an attribute on the exception class was the way 
> to do it. 
> 
> Any guidance would be great. 
> 
> Thanks 
> Dave 
_______________________________________________ 
SAP-WUG mailing list 
SAP-WUG at mit.edu 
http://mailman.mit.edu/mailman/listinfo/sap-wug 





More information about the SAP-WUG mailing list