Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Nested Exception Handling

Former Member
0 Likes
1,394

Dear All,

REPORT 1

calls a class CLASS 1 -> METHOD1

TRY.

CLASS 1 -> METHOD1 calls a Funnction Module FM1

CATCH.

ENDTRY.

*****************************************************************************

FM1 calls CLASS 1 -> METHOD2

CLASS 1 -> METHOD2 calls

if X1

CLASS 1 -> METHOD3

          Raises Exception class CX1

elseif X2

        if XX1

             CLASS 1 -> METHOD4

                Raises Exception class CX1

        else XX2

             CLASS 1 -> METHOD5

              Raises Exception class CX1

        endif.

endif.

How can I revert back to the report program REPORT1 with the raised exception.

I have tried the CLEANUP statement, it cleans up the exception if not caught in the TRY-CATCH-ENDTRY block.

Should the exception be caught in every caller program and propagated outside the call.

4 REPLIES 4
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,020

Should the exception be caught in every caller program and propagated outside the call.

If you want to propagate an exception, why do you want to catch it?

In order to propagate the exception to the original report then define it in the procedure's (method, FM, subroutine) signature. I don't think that CLEANUP would serve the purpose.

BR,

Suhas

Read only

Former Member
0 Likes
1,020

I have defined that in the signature of all the caller program,

but gives a short dump after being raised.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,020

Soumen Das wrote:

I have defined that in the signature of all the caller program,

but gives a short dump after being raised.

Short dump => the exception was not handled in the caller / incorrect exception was handled. Without additional details it's not possible to analyse your problem.

Read only

0 Likes
1,020

Hi Das,

Are you calling one program from another?