ABAPRAISE_SHORTDUMP - RAISE SHORTDUMP
ABAPRAISE_SHORTDUMP - RAISE SHORTDUMP
SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up
ROGBILLS - Synchronize billing plans
This documentation is copyright by SAP AG.
RAISE SHORTDUMP
Short Reference
RAISE SHORTDUMP
${ ${TYPE cx_class $[message$] $[EXPORTING p1 = a1 p2 = a2 ...$]$}
$| oref $}.
Effect
This statement interrupts the execution of the current statement block and raises the
runtime error RAISE_SHORTDUMP, which performs a
database rollback. This runtime error is linked with an
exception object using TYPE or oref:
- If the addition TYPE is specified, an exception object of the
exception class cx_class is created. Every exception class cx_class visible at this point can be specified after TYPE. The
exception category is ignored.
- The addition EXPORTING can be used to assign actual parameters to the input parameters of
the instance constructor. The syntax and semantics are the same as for the statement RAISE EXCEPTION.
- The addition message can be used to link the exception object to a
message.
- If oref is specified, no new exception object is created. oref expects an object reference
variable that points to an existing exception object. The static type of oref must be an exception class, that is, a subclass of CX_ROOT or the class itself. oref is a
general
expression position. In the existing exception object, the internal attributes that describe the location of the exception are converted to the position of the RAISE statement.
The short dump of the runtime error contains the name of the exception class and the
exception text. The attributes of the exception object can be listed in the transaction
ST22. Under Chain
of Exception Objects, the long text of the short dump contains the attributes referenced in the attribute PREVIOUS of the exception object.
Notes
- The statement RAISE SHORTDUMP works in roughly the same way as when raising a
class-based exception that does not have a handler. There is no
propagation from procedures, however, which removes the risk of violating interfaces and raising further exceptions such as CX_SY_NO_HANDLER. This means that the
exception category of the used exception class is not relevant in RAISE SHORTDUMP.
- The statement RAISE SHORTDUMP does not raise
class-based
exception that can be caught using CATCH. The exception object is used exclusively for the transport of information to the short dump.
- The statement RAISE SHORTDUMP is an alternative to raising
exit messages, that is,
messages of type
X. The attributes of the exception class
can be used to send more information about an error to the short dump than a message text. More specifically, the attribute PREVIOUS can reference previous exceptions.
- If oref is specified, either an exception object instantiated using NEW
or CREATE OBJECT can be used or a previously caught exception can be transformed into a runtime error in exception handling.
- If a caught exception is transformed into a runtime error, it should be noted that the exception
object does not remain unchanged and the information about the position of the exception is changed
instead. If the original information is transported to the short dump, a new exception object of the
same class can be created. The original exception object is passed to the constructor parameter PREVIOUS of the new object.
Example
Raising of a runtime error with an exception object of the exception class
CX_DEMO_T100. The instance constructor is supplied with parameters that define the exception text and supply any variable text parts with values.
Example
Like the previous example, but the exception object is created first and not in the statement RAISE SHORTDUMP.
Example
Raising of a runtime error when an exception is handled. A reference to the preceding exception object
of the class cx_sy_zerodivide is passed to the attribute PREVIOUS of the created exception object
of the class cx_demo. The chain of exception objects is listed in the long text of the short dump.
General Material Data
Fill RESBD Structure from EBP Component Structure
This documentation is copyright by SAP AG.
Length: 7148 Date: 20230322 Time: 100550 sap01-206 ( 114 ms )