{"id":215,"date":"2024-01-25T02:32:07","date_gmt":"2024-01-25T02:32:07","guid":{"rendered":"https:\/\/sapabap.dwimansolution.com\/?p=215"},"modified":"2024-01-25T02:32:37","modified_gmt":"2024-01-25T02:32:37","slug":"sap-abap-handling-shortdump","status":"publish","type":"post","link":"https:\/\/sapabap.dwimansolution.com\/index.php\/2024\/01\/25\/sap-abap-handling-shortdump\/","title":{"rendered":"SAP ABAP &#8211; Handling Shortdump"},"content":{"rendered":"\n<p>Bismillah.<\/p>\n\n\n\n<p>Hello Friends,<\/p>\n\n\n\n<p>Eventually, when we ran the SAP program, whether it was a custom program or a standard program, we just bumped into a <strong>short dump<\/strong> . In ABAP, we can handle this short dump with some code. Here we go!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example<\/h2>\n\n\n\n<p>If we execute a program like this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DATA:\r\n    lv_val_1  TYPE i,\r\n    lv_val_2  TYPE i,\r\n    lv_result TYPE i.\r\n\r\n  lv_val_1 = 10.\r\n  lv_val_2 = 0.\r\n  lv_result = lv_val_1 \/ lv_val_2.<\/code><\/pre>\n\n\n\n<p>Then we must bump into short dump like below<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"729\" height=\"579\" src=\"https:\/\/sapabap.dwimansolution.com\/wp-content\/uploads\/2024\/01\/image-15.png\" alt=\"\" class=\"wp-image-220\" srcset=\"https:\/\/sapabap.dwimansolution.com\/wp-content\/uploads\/2024\/01\/image-15.png 729w, https:\/\/sapabap.dwimansolution.com\/wp-content\/uploads\/2024\/01\/image-15-300x238.png 300w\" sizes=\"(max-width: 729px) 100vw, 729px\" \/><\/figure>\n\n\n\n<p>We can see the short dump occurred raised by exception CX_SY_ZERODIVIDE<\/p>\n\n\n\n<p>We can catch the exception in the program like below so the program will not throw the short dump.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DATA:\r\n    lv_val_1  TYPE i,\r\n    lv_val_2  TYPE i,\r\n    lv_result TYPE i.\r\n\r\n  lv_val_1 = 10.\r\n  lv_val_2 = 0.\r\n  TRY.\r\n      lv_result = lv_val_1 \/ lv_val_2.\r\n    CATCH cx_sy_zerodivide.\r\n  ENDTRY.<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, try to get the messages<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DATA:\r\n    lv_val_1  TYPE i,\r\n    lv_val_2  TYPE i,\r\n    lv_result TYPE i.\r\n\r\n  lv_val_1 = 10.\r\n  lv_val_2 = 0.\r\n  TRY.\r\n      lv_result = lv_val_1 \/ lv_val_2.\r\n    CATCH cx_sy_zerodivide INTO DATA(lx_zerodiv).\r\n      WRITE:\/ lx_zerodiv->get_text( ). \" retrieve short text\r\n      WRITE:\/ lx_zerodiv->get_longtext( ). \" retrieve long text\r\n  ENDTRY.<\/code><\/pre>\n\n\n\n<p>This method can be applied to other exceptions too. <\/p>\n\n\n\n<p>That&#8217;s all.<\/p>\n\n\n\n<p>Thank you for reading this post. If there is any feedback just put it in the comment.<\/p>\n\n\n\n<p>I hope you can do better. See you in another post \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 Then we must bump into&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/posts\/215"}],"collection":[{"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/comments?post=215"}],"version-history":[{"count":5,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions\/224"}],"wp:attachment":[{"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/media?parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/categories?post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/tags?post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}