stringdebuggingabap

View the end of a long string in ABAP debugger


In my ABAP function module, I have a string containing some megabyte of printable characters.

During debugging with se80, I would like to see the end of the string.

How to see the last 20 characters of the string?


Solution

  • You can see the technical type in the debugger which shows the actual length of a string. Here is an example.

    REPORT ZZZ.
    
    DATA(g_string) = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`.
    
    BREAK-POINT.
    

    In this example the technical type is CString{52}. With this information you can calculate the offset by yourself 52 - 20 = 32 and then type your variable like that in the debugger g_string+32(20).

    Example screenshots for a huge XString variable: