How to Generate a Dump in an ABAP Program?

Clarification of the Question

At first glance, the title of this note sounds quite intense—maybe not a full-blown fire, but definitely “hot.” Some may argue that there are many standard ways to generate a dump: from a simple programming error to thorough testing of a particular development.

See: Categories of ABAP Runtime Errors
See: ABAP Runtime Errors and Short Dumps

In this note, I want to explore a situation that goes beyond the examples mentioned above. I’m considering a case where there is a need to deliberately trigger a dump in an ABAP program to handle some exceptional (erroneous) situation. Doing this is actually not very difficult.

Solution

  1. Create a message that should appear when the dump is triggered (Transaction SE91).
  1. Call the created message in your program.

Pay attention to the type of message being called (TYPE = X), which can be easily determined when adding a message by clicking the corresponding button in the ABAP editor (Transaction SE38).

See:  Message
Non-Handleable Exceptions

Cause:
Unknown message type
Runtime Error: MESSAGE_TYPE_UNKNOWN

Cause: Deliberate termination with short dump
Runtime Error: MESSAGE_TYPE_X
Runtime Error: MESSAGE_TYPE_X_TEXT

Cause: It is not possible to catch messages of type ‘A’ using the language element CALL FUNCTION ... EXCEPTIONS error_message during ON COMMIT processing.
Runtime Error: MESSAGE_ROLLBACK_ON_COMMIT

Cause: It is not possible to catch messages of type ‘A’ using the language element CALL FUNCTION ... EXCEPTIONS error_message during an update.
Runtime Error: MESSAGE_ROLLBACK_IN_POSTING
0:00
/0:23

Testing


0:00
/0:18