An exception was raised (Message No. SY530)
CLASS zcl_get_root_exception DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS get_root_exception
IMPORTING
!ix_exception TYPE REF TO cx_root
RETURNING
VALUE(rx_root) TYPE REF TO cx_root .
ENDCLASS.
CLASS zcl_get_root_exception IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
TRY.
DATA num1 TYPE i VALUE 2.
DATA num2 TYPE i VALUE 0.
DATA(result) = Num1 / Num2.
out->write( result ).
CATCH cx_root INTO DATA(lx_exception).
out->write( 'root exception: ' && get_root_exception( lx_exception )->get_longtext( ) ).
ENDTRY.
ENDMETHOD.
METHOD get_root_exception.
rx_root = ix_exception.
WHILE rx_root->previous IS BOUND.
rx_root ?= rx_root->previous.
ENDWHILE.
ENDMETHOD.
ENDCLASS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
31 | |
24 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |