ABAP Dump Texts – Quick and Dirty
Matthew Billingham has written a helpful blog about ABAP dumps.
From my point of view a lot of helpful information is already contained in the short dump texts.
You might be interested to see these texts without having to raise the exception.
The following – quick and dirty – program can be used as a starting point.
Simply enter the dump id, e.g. COMPUTE_INT_ZERODIVIDE or TIME_OUT, in the selection screen and see the short dump text.
Kind of poor man’s ST22.
No guarantee that it works in all cases. I tested some. Feel free to report errors or to improve that little hack.
REPORT …
PARAMETERS errid TYPE snapt-errid.
CLASS write_dump DEFINITION.
PUBLIC SECTION.
CLASS-METHODS main.
PRIVATE SECTION.
CLASS-METHODS write_section
IMPORTING VALUE(errid) LIKE errid
section TYPE snapt-ttype.
ENDCLASS.
CLASS write_dump IMPLEMENTATION.
METHOD main.
WRITE / errid COLOR COL_HEADING.
SKIP.
WRITE / ‘What happened?’ COLOR COL_HEADING.
write_section( errid = errid
section = ‘W’ ).
SKIP.
WRITE / ‘What can I do?’ COLOR COL_HEADING.
write_section( errid = errid
section = ‘T’ ).
SKIP.
WRITE / ‘Error analysis’ COLOR COL_HEADING.
write_section( errid = errid
section = ‘U’ ).
SKIP.
WRITE / ‘Hints for Error handling’ COLOR COL_HEADING.
write_section( errid = errid
section = ‘H’ ).
SKIP.
WRITE / ‘Internal notes’ COLOR COL_HEADING.
write_section( errid = errid
section = ‘I’ ).
SKIP.
ENDMETHOD.
METHOD write_section.
DATA tline TYPE snapt-tline.
DATA sect TYPE snapt-ttype.
SELECT tline ttype
FROM snapt INTO (tline,sect)
WHERE langu = sy-langu AND
errid = errid AND
ttype = section
ORDER BY seqno.
IF strlen( tline ) >= 8 AND
tline(8) = ‘&INCLUDE’.
REPLACE ‘&INCLUDE’ IN tline WITH “.
CONDENSE tline.
errid = tline.
write_section( errid = errid
section = sect ).
ELSE.
WRITE / tline.
ENDIF.
ENDSELECT.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
write_dump=>main( ).
Hi,
how were you able to create a NON 'Z'/'Y' program? or do you have some extra privileges which we developers don't? 🙂
Thanks for the post...
Skipped the name.
Since I'm developing in a SAP system, I can of course use SAP names.
You can name it as you want ...
Hi Horst,
Nice Post Sir.
I have not implemented it, in my system but the coading style impressed me.
Thanking You All..!!
Coding, not Coading.
And it's described as quick and dirty... it's not to be used as an example of how to code (I hope!).
Hi Matthew,
Thanks for the guidance and inputs.
I meant the OOPS fashion, used by Horst..!!
I always learn here from you people and its just one more step.
Thanking You All..!!
Hi
Very helpful post
Maybe you can consider the FM RS_ST22_GET_FT for obtain more details about the dump.
Regards
Gregory
Hmm, that's from function group SAPLST22_TOOLS that analyses short dumps stored in the system. For that I can use TA ST22 itself. The above program gets short dump texts by error id independent from the storage of short dumps that happened in the system.
Hello Horst,
I added language as a selection parameter, it is the 2nd report here: SCN Wiki Code Gallery Entry
JNN
But no prefixes lv_id ... there ? 😉