<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Re: Exception Handling in ABAP OO and Workflow</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=732454700-15112006><FONT face=Arial 
color=#0000ff size=2>Well ... technically because it is an abstract 
class</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=732454700-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=732454700-15112006><FONT face=Arial 
color=#0000ff size=2>Functionally ... because just to say its an application 
error really doesn't help you to understand what's causing the problem.&nbsp; So 
its good practice to create a more specific exception to give the poor old 
workflow system and administrator some small clue as to what is going on.&nbsp; 
Plus by using a specific exception class you can activate that specfic exception 
as a handled outcome in your workflow design. </FONT></SPAN></DIV>
<DIV>&nbsp;</DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><FONT face=Arial size=1>Regards,</FONT></SPAN> <BR><SPAN 
lang=en-us><B><FONT face=Arial color=#000080 size=1>Jocelyn 
Dart</FONT></B></SPAN> <BR><SPAN lang=en-us><FONT face=Arial color=#808080 
size=1>Senior Consultant</FONT></SPAN> <BR><SPAN lang=en-us><B><FONT face=Arial 
color=#808080 size=1>SAP Australia Pty Ltd.</FONT></B></SPAN> <BR><SPAN 
lang=en-us><FONT face=Arial color=#808080 size=1>Level 1/168 Walker 
St.</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Arial color=#808080 
size=1>North Sydney </FONT></SPAN><BR><SPAN lang=en-us><FONT face=Arial 
color=#808080 size=1>NSW, 2060</FONT></SPAN> <BR><SPAN lang=en-us><FONT 
face=Arial color=#808080 size=1>Australia</FONT></SPAN> <BR><SPAN 
lang=en-us><FONT face=Arial color=#808080 size=1>T&nbsp;&nbsp; +61 412 390 
267</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Arial color=#808080 
size=1>M&nbsp;&nbsp; + 61 412 390 267</FONT></SPAN> <BR><SPAN lang=en-us><FONT 
face=Arial color=#808080 size=1>E&nbsp;&nbsp; jocelyn.dart@sap.com</FONT></SPAN> 
<BR><SPAN lang=en-us><FONT face=Arial color=#808080 size=1><A 
href="http://www.sap.com/">http://www.sap.com</A></FONT></SPAN> </P>
<P><SPAN lang=en-au><FONT face="Times New Roman" color=#ff0000 size=1>The 
information contained in or attached to this electronic transmission is 
confidential and may be legally privileged. It is intended only for the person 
or entity to which it is addressed. If you are not the intended recipient, you 
are hereby notified that any distribution, copying, review, retransmission, 
dissemination or other use of this electronic transmission or the information 
contained in it is strictly prohibited. If you have received this electronic 
transmission in error, please immediately contact the sender to arrange for the 
return of the original documents. </FONT></SPAN></P>
<P><SPAN lang=en-au><FONT face="Times New Roman" color=#ff0000 size=1>Electronic 
transmission cannot be guaranteed to be secure and accordingly, the sender does 
not accept liability for any such data corruption, interception, unauthorized 
amendment, viruses, delays or the consequences thereof.</FONT></SPAN></P>
<P><SPAN lang=en-au><FONT face="Times New Roman" color=#ff0000 size=1>Any views 
expressed in this electronic transmission are those of the individual sender, 
except where the message states otherwise and the sender is authorized to state 
them to be the views of SAP AG or any of its subsidiaries. SAP AG, its 
subsidiaries, and their directors, officers and employees make no representation 
nor accept any liability for the accuracy or completeness of the views or 
information contained herein. Please be aware that the furnishing of any pricing 
information/ business proposal herein is indicative only, is subject to change 
and shall not be construed as an offer or as constituting a binding agreement on 
the part of SAP AG or any of its subsidiaries to enter into any relationship, 
unless otherwise expressly stated. </FONT></SPAN></P>
<DIV>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> sap-wug-bounces@mit.edu 
[mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of </B>Alon Raskin<BR><B>Sent:</B> 
Wednesday, 15 November 2006 7:41 AM<BR><B>To:</B> SAP Workflow Users' 
Group<BR><B>Subject:</B> RE: Exception Handling in ABAP OO and 
Workflow<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV id=idOWAReplyText61693 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000></FONT>Mike,</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>You are right. While I was waiting for someone to respond I tried 
creating my own sub-type of cx_bo_application and that fixed the problem.</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>My issue with this, is academic. Why do I <EM>have</EM> to create a 
subtype to use this? I have not reason to 'enhance' the SAP delivered class so 
why create a sub-type? Particularly when you don't have to do this for the other 
exception classes ( CX_BO_TEMPORARY, CX_BO_ACTION_CANCELLED, etc)....</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>Appreciate the response regardless.</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>Alon</DIV>
<P dir=ltr align=left></P>
<DIV dir=ltr><BR></DIV>
<DIV dir=ltr>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr><FONT face=Tahoma size=2><B>From:</B> sap-wug-bounces@mit.edu on 
behalf of Mike Pokraka<BR><B>Sent:</B> Tue 11/14/2006 11:52<BR><B>To:</B> SAP 
Workflow Users' Group<BR><B>Subject:</B> Re: Exception Handling in ABAP OO and 
Workflow<BR></FONT><BR></DIV></DIV>
<DIV>
<P><FONT size=2>Hi Alon,<BR><BR>It does what it says on the tin, 
cx_bo_application is abstract and should<BR>not be used other than perhaps to 
catch subclasses.<BR><BR>Use any of the existing subclasses or define your own. 
cx_bo_error for<BR>errors and cx_bo_temporary for .. er, temporary errors, and 
cx_bo_abort<BR>for system errors. You can even create your own subclasses from 
the above<BR>and it will behave according to it's subcleass (i.e. temporary 
error<BR>etc.). Exception classes excellent and so much more 
useful.<BR><BR>Cheers,<BR>Mike<BR><BR><BR>On Tue, November 14, 2006 16:05, Alon 
Raskin wrote:<BR>&gt; So I finally took the plunge and created my first ABAP OO 
Workflow.<BR>&gt;<BR>&gt; I implemented a class which inherits from IF_WORKFLOW, 
BI_PERSISTENT and<BR>&gt; BI_OBJECT.<BR>&gt;<BR>&gt; Everything was going well 
till I tried to raise an exception from my<BR>&gt; method using the standard 
exception classes. Here is an excerpt from my<BR>&gt; code...<BR>&gt;<BR>&gt; 
...<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF sy-subrc &lt;&gt; 
0.<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RAISE EXCEPTION type 
cx_bo_application.<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF.<BR>&gt; 
...<BR>&gt;<BR>&gt; When I compile I get the error saying that You cannot 
generate instances<BR>&gt; of the abstract class 'cx_bo_application'. I can see 
that the<BR>&gt; instantiation scope is marked as abstract but surely I don't 
have define a<BR>&gt; concrete child class of cx_bo_application for every 
exception that I want<BR>&gt; to raise? Or do I just need to do one per workflow 
(seems redundant).<BR>&gt;<BR>&gt; Oh and I went to the method definition and 
checked the exception classes<BR>&gt; checkbox (in the class builder) and pasted 
in cx_bo_application. It seemed<BR>&gt; happy with that but it didn't make my 
syntax error go away.<BR>&gt;<BR>&gt; Perhaps I am using the wrong syntax in the 
method ? I checked OSS...<BR>&gt; nothing. I checked SDN... 
nothing.<BR>&gt;<BR>&gt; I am using ECC 6.0 with SAP_BASIS and SAP_ABA release 
7.00<BR>&gt;<BR>&gt; I will keep trying other things but I welcome your 
comments.<BR>&gt;<BR>&gt; Alon<BR>&gt;<BR>&gt;<BR>&gt; Your comments are 
welcome.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; 
_______________________________________________<BR>&gt; SAP-WUG mailing 
list<BR>&gt; SAP-WUG@mit.edu<BR>&gt; <A 
href="http://mailman.mit.edu/mailman/listinfo/sap-wug">http://mailman.mit.edu/mailman/listinfo/sap-wug</A><BR>&gt;<BR><BR><BR>_______________________________________________<BR>SAP-WUG 
mailing list<BR>SAP-WUG@mit.edu<BR><A 
href="http://mailman.mit.edu/mailman/listinfo/sap-wug">http://mailman.mit.edu/mailman/listinfo/sap-wug</A><BR></FONT></P></DIV></BODY></HTML>