Skip to content

abapPM/ABAP-Error

Repository files navigation

Version

License Contributor Covenant REUSE Status

Error

General-purpose exception classes. Support for RAISE EXCEPTION statement (recommended and better debugging) and class methods (shorter code).

NO WARRANTIES, MIT License

Usage

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( ).

Prerequisites

SAP Basis 7.50 or higher

Installation

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.

Contributions

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

About

Made with ❤ in Canada

Copyright 2025 apm.to Inc. https://apm.to

Follow @marcf.be on Bluesky and @marcfbe or LinkedIn

About

General Purpose Exception Class

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Languages