Skip to content
Skip to content
Menu
SAP ABAP DWIMAN
  • About
SAP ABAP DWIMAN

SAP ABAP – Handling Shortdump

By juananda.satria on January 25, 2024January 25, 2024

Bismillah.

Hello Friends,

Eventually, when we ran the SAP program, whether it was a custom program or a standard program, we just bumped into a short dump . In ABAP, we can handle this short dump with some code. Here we go!

Example

If we execute a program like this

  DATA:
    lv_val_1  TYPE i,
    lv_val_2  TYPE i,
    lv_result TYPE i.

  lv_val_1 = 10.
  lv_val_2 = 0.
  lv_result = lv_val_1 / lv_val_2.

Then we must bump into short dump like below

We can see the short dump occurred raised by exception CX_SY_ZERODIVIDE

We can catch the exception in the program like below so the program will not throw the short dump.

  DATA:
    lv_val_1  TYPE i,
    lv_val_2  TYPE i,
    lv_result TYPE i.

  lv_val_1 = 10.
  lv_val_2 = 0.
  TRY.
      lv_result = lv_val_1 / lv_val_2.
    CATCH cx_sy_zerodivide.
  ENDTRY.

Next, try to get the messages

  DATA:
    lv_val_1  TYPE i,
    lv_val_2  TYPE i,
    lv_result TYPE i.

  lv_val_1 = 10.
  lv_val_2 = 0.
  TRY.
      lv_result = lv_val_1 / lv_val_2.
    CATCH cx_sy_zerodivide INTO DATA(lx_zerodiv).
      WRITE:/ lx_zerodiv->get_text( ). " retrieve short text
      WRITE:/ lx_zerodiv->get_longtext( ). " retrieve long text
  ENDTRY.

This method can be applied to other exceptions too.

That’s all.

Thank you for reading this post. If there is any feedback just put it in the comment.

I hope you can do better. See you in another post 🙂

Post navigation

SAP ABAP – Copy ABAP Programs using ABAPGIT Offline
SAP ABAP – BS01_SALESDOCUMENT_CREATE

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • SAP ABAP – Generate Fiori URL
  • SAP ABAP – Workflow Agents CDS
  • SAP ABAP – Workflow Level with Table Function
  • SAP ABAP – Download ALV to Excel with Total and Subtotal
  • SAP ABAP – BDC Template

Recent Comments

  1. SAP ABAP – Simple Interface FTP Inbound (SAP Consume File From FTP) – SAP ABAP DWIMAN on SAP ABAP – String Encode & Decode BASE64
  2. Upload file – SAP ABAP DWIMAN on F4 Search Help File

Archives

  • May 2025
  • August 2024
  • June 2024
  • May 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • May 2023
  • April 2023

Categories

  • Uncategorized
©2026 SAP ABAP DWIMAN | WordPress Theme by SuperbThemes.com