Skip to content

Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE

Note: Available from NW 7.52 onwards.

RAISE EXCEPTION NEW cx_generation_error( previous = exception ).

in general is shorter than the needlessly longer

RAISE EXCEPTION TYPE cx_generation_error
  EXPORTING
    previous = exception.

However, if you make massive use of the addition MESSAGE, you may want to stick with the TYPE variant:

RAISE EXCEPTION TYPE cx_generation_error
  MESSAGE e136(messages)
  EXPORTING
    previous = exception.
From SAP/styleguides under CC BY 3.0 — more details
Last updated on