Exception Handling in ABAP OO and Workflow

Mike Pokraka asap at workflowconnections.com
Tue Nov 14 11:52:01 EST 2006


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
>





More information about the SAP-WUG mailing list