General-purpose exception classes. Support for RAISE EXCEPTION
statement (recommended and better debugging) and class methods (shorter code).
NO WARRANTIES, MIT License
Raise an exception with free-form text:
RAISE EXCEPTION TYPE /apmg/cx_error_text EXPORTING text = 'Not found'.
" or
/apmg/cx_error=>raise( 'Not found' ).
Raise an exception concerning another exception:
TRY.
"... some code that raises an exception
CATCH cx_root INTO DATA(error).
RAISE EXCEPTION TYPE /apmg/cx_error_prev EXPORTING previous = previous.
" or
/apmg/cx_error=>raise_with_text( error ).
" or
/apmg/cx_error=>raise(
text = 'Overwrite error text'
previous = error ).
ENDTRY.
Raise an exception with T100 system message:
MESSAGE e001(00) WITH 'error value' 'more text' INTO /apmg/cx_error=>null. " or any other message
RAISE EXCEPTION TYPE /apmg/cx_error_t100.
" or
/apmg/cx_error=>raise_t100( ).
SAP Basis 7.50 or higher
Install error
as a global module in your system using apm.
or
Specify the error
module as a dependency in your project and import it to your namespace using apm.
All contributions are welcome! Read our Contribution Guidelines, fork this repo, and create a pull request.
You can install the developer version of ABAP Error using abapGit either by creating a new online repository for https://github.com/abapPM/ABAP-Error
.
Recommended SAP package: /APMG/ERROR
Made with ❤ in Canada
Copyright 2025 apm.to Inc. https://apm.to