0

using RAISE EXCEPTION TYPE and not get the runtime error UNCAUGHT_EXCEPTION

Oct 13, 2016 at 07:00 AM

77

I'm trying to use RAISE EXCEPTION TYPE within a method.

But when I test the path I get an UNCAUGHT_EXCEPTION exception run time error.

I've googled for solutions and I can't find any answers. I've seen other code usage doing the same thing in other programs so it works. I am missing something...

Thank you in advance for help.

Glenn Allen

<personal information removed by moderator>

capture.jpg (107.0 kB)
capture1.jpg (133.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Matthew Billingham Moderator Oct 13, 2016 at 07:05 AM
1

From the dump, it looks like you've thrown the error from your method, but nothing further up the call hierarchy has caught it. The calling method must either handle the exception, or throw it up to a higher level.

e.g

TRY.

object->get_current_per_yr( .... ).

CATCH zcx_zz_msg into DATA(error).  " Error handling

ENDTRY.
Share
10 |10000 characters needed characters left characters exceeded
Horst Keller SAP Employee Oct 13, 2016 at 10:37 AM
0
Share
10 |10000 characters needed characters left characters exceeded
Naimesh Patel Nov 02, 2016 at 04:23 PM
0

You need to have the TRY.. CATCH .. ENTRY block to catch this exception where the method is being called. If you are not calling this method directly but, this method is called from another method, then all the methods of the call stack needs to have the exception declared in the method signature.

Refer:

Regards.

Share
10 |10000 characters needed characters left characters exceeded

Your answer

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.