Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

TRY to CATCH a system exception

Hi,

in a class, i have two methods, let me call them A and B.

method A is calling method B. In method B an exception CX_SY_CONVERSION_NO_NUMBER may occur. So the code is something like this in method A:


TRY.
  me->B( par ).

  catch CX_SY_CONVERSION_NO_NUMBER.
    do_some_error_handling

ENDTRY.

Stll the program abends with an uncaught exception CX_SY_CONVERSION_NO_NUMBER which occured in method B. Why isnt this be caught in method A? How can i handle this in method A with try and catch?

Tags:
Former Member
replied

Hi..

Here the Exception is triggered by method B. So u must have to code like this.

in the Method B Definition you must add the addition

RAISING CX_SY_CONVERSION_NO_NUMBER as a parameter. Then this code works.

TRY.

me->B( par ).

catch CX_SY_CONVERSION_NO_NUMBER.

do_some_error_handling

ENDTRY.

REWARD IF HELPFUL.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question