Exception Handling in ABAP OO and Workflow

Alon Raskin araskin at 3i-consulting.com
Tue Nov 14 15:40:43 EST 2006


Mike,
 
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.
 
My issue with this, is academic. Why do I have 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)....
 
Appreciate the response regardless.
 
Alon


________________________________

From: sap-wug-bounces at mit.edu on behalf of Mike Pokraka
Sent: Tue 11/14/2006 11:52
To: SAP Workflow Users' Group
Subject: Re: Exception Handling in ABAP OO and Workflow



Hi Alon,

It does what it says on the tin, cx_bo_application is abstract and should
not be used other than perhaps to catch subclasses.

Use any of the existing subclasses or define your own. cx_bo_error for
errors and cx_bo_temporary for .. er, temporary errors, and cx_bo_abort
for system errors. You can even create your own subclasses from the above
and it will behave according to it's subcleass (i.e. temporary error
etc.). Exception classes excellent and so much more useful.

Cheers,
Mike


On Tue, November 14, 2006 16:05, Alon Raskin wrote:
> So I finally took the plunge and created my first ABAP OO Workflow.
>
> I implemented a class which inherits from IF_WORKFLOW, BI_PERSISTENT and
> BI_OBJECT.
>
> Everything was going well till I tried to raise an exception from my
> method using the standard exception classes. Here is an excerpt from my
> code...
>
> ...
>       IF sy-subrc <> 0.
>       RAISE EXCEPTION type cx_bo_application.
>     ENDIF.
> ...
>
> When I compile I get the error saying that You cannot generate instances
> of the abstract class 'cx_bo_application'. I can see that the
> instantiation scope is marked as abstract but surely I don't have define a
> concrete child class of cx_bo_application for every exception that I want
> to raise? Or do I just need to do one per workflow (seems redundant).
>
> Oh and I went to the method definition and checked the exception classes
> checkbox (in the class builder) and pasted in cx_bo_application. It seemed
> happy with that but it didn't make my syntax error go away.
>
> Perhaps I am using the wrong syntax in the method ? I checked OSS...
> nothing. I checked SDN... nothing.
>
> I am using ECC 6.0 with SAP_BASIS and SAP_ABA release 7.00
>
> I will keep trying other things but I welcome your comments.
>
> Alon
>
>
> Your comments are welcome.
>
>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>


_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 6419 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20061114/9ee9d96e/attachment.bin


More information about the SAP-WUG mailing list