Exception Handelling in Work Flow

Dart, Jocelyn jocelyn.dart at sap.com
Tue Feb 19 04:55:38 EST 2002


Hi Stephan,
The reason why you can't use exit_return (or any other exit macro)
in a subroutine of your object code is because the exit macros essentially
set up the error message and exception outcome trigger then execute the
ABAP statement "EXIT."
 
As the begin/end method macros (or the begin/end property macros)
create a subroutine for the method code (or attribute code), when you
execute an EXIT statement in that method code (or attribute code), you
are exiting from the same subroutine.  If you call a subroutine from your
method (or attribute), and put an exit macro in that subroutine, it only
exits from the called subroutine, not from the calling method (or
attribute).
 
This is according to normal ABAP rules ....
 
form subroutine_parent.
  perform subroutine_child.
  ...
* This exit statement if executed will cause the program to
* go directly to the endform statement of subroutine_parent
  EXIT.
  ...
endform.
 
form subroutine_child.
  ...
* This exit statement if executed will cause the program to
* go directly to the endform statement of subroutine_child
* It does not affect subroutine_parent.
  EXIT.
  ...
endform.
 
Hence you can't use the exit macro in a subroutine, just get the subroutine
to return some sort of parameter,e.g. error_flag, that you use to decide
if you need to exit the calling method or attribute code.
 
P.S. I usually avoid using exit macros in attribute code anyway as they
can cause unexpected terminations in start conditions and check function
modules.
Instead I return an empty value if the correct attribute value cannot be
determined.
 
Hope this helps. Remember always that macros are combinations of ABAP
statements -
they can't break the rules of normal ABAP code.
Regards,
        Jocelyn Dart
Consultant (EBP, BBP, Ecommerce, Internet Transaction Server, Workflow)
SAP Australia
Email jocelyn.dart at sap.com <mailto:jocelyn.dart at sap.com>
Tel: +61 412 390 267
Fax: +61 2 9935 4880
 
 
-----Original Message-----
From: Becker Stephan (extern)
[mailto:Stephan.Becker.ext at mchw.siemens.de]
Sent: Tuesday, 19 February 2002 8:23 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Exception Handelling in Work Flow
 
 
Manjula,
 
have a look at the good old workflow documentation, this is well documented
there..
 
You create exceptions in the code with the macro command exit_return and
then the number of the exception defined in the object builder, plus the
parameters.
 
ANYONE, why can't exceptions be raised in forms within the object code? This
always strikes me as a bit of an unnecessary limitation..
 
To define an exception, mark the method in the object builder and hit the
button exceptions, then select create..
 
Once the exceptions are defined in the object, the workflow builder will
pick them up in tab "outcomes" of the activity maintenance, and you can
model them as any other event in the builder. To see the events in the
builder properly, switch on the EPC graphics (in the settings of the
builder).. makes the whole thing easier to comprehend, I find..
 
Cheerio,
Stephan
 
-----Original Message-----
From: Devi, Manjula [mailto:manjula.devi at atosorigin.com]
Sent: Dienstag, 19. Februar 2002 10:13
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Exception Handelling in Work Flow
 
 
Hello Everybody,
 
        I want to know how can we handel exception raised by the called
method of a WorkFlow Task inside a WorkFlow.
        Also while designing Business Object for WorkFlow we can have three
types of EXCEPTIONS Raised from the Method namely Application, System and
Temporary. What is the difference between them? Which one to be used when?
And How can we capture them in WorkFlow.
 
Regards
 
Manjula
 


More information about the SAP-WUG mailing list