abapcallstacksap-hr

Strange prefix (/A\) in ABAP call stack


Generally I try to make my questions Reproducible. In this case I couldn't find a way. Please feel free to guide me how to grab more details and I will attach.

In some cases, we are using the ABAP call stack programmatically to get additional info. I.E: logging user calls, accessing variables from lower calls in the stack as a last resort when there is no other proper way to retrieve them.

We have encountered a case, in which weird chars were added as a prefix in the call stack for central programs of HR module 'MP9XXX00'(Module-Pool generated programs for customer-specific PA infotypes). The weird chars are /A\. The full string for calling program is /A\MP9XXX00.

The code used to get the whole call stack:

lt_call = cl_abap_get_call_stack=>format_call_stack_with_struct( cl_abap_get_call_stack=>get_call_stack( ) ).

There aren't such programs /A\MP9XXX00 in SE80.

Also, when tried to receive variables from calling program as mentioned, like this: ASSIGN |( { ls_call-prog })PSYST| it failes, it caused dump. And when we looked into ST22 the stack didn't contain any /A\MP9XXX00 but just MP9XXX00 (ls_call-prog contained /A\MP9XXX00).

As said, we didn't manage to reproduce and debug it. just saw the result.

Where could those chars come from?

What we thought of

  1. We thought that it might be related to the fact that our customer namespace starts with /A, but still, why it's shown up? why just a few times? why just the first two characters? and where did the other \ come from?
  2. We thought that the prefix /A\ might be temporary added to (those) program names, say while importing related transport requests. And that maybe A is for Active/Activating. What made us think so is that it happens more in QA than in production.

Solution

  • With CL_ABAP_GET_CALL_STACK, /A\ are normal characters part of the internal/unformatted data of the ABAP call stack (method GET_CALL_STACK) and it must be formatted so that to remove /A\ (methods FORMAT_CALL_STACK or FORMAT_CALL_STACK_WITH_STRUCT).

    Here are the three ABAP call stack representations, of course FORMAT_CALL_STACK_WITH_STRUCT is the easiest to use:

    Backend Two-Process ABAP Debugger with 3 Tables of formats of CL_ABAP_GET_CALL_STACK

    Result of GET_CALL_STACK:

    Result of FORMAT_CALL_STACK (lines of type STRING):

    Result of FORMAT_CALL_STACK_WITH_STRUCT (lines with 6 components):

    ABAP code for the test:

    REPORT zzsro_test01.
    PERFORM my_subroutine.
    FORM my_subroutine.
      DATA(unformatted_call_stack) = cl_abap_get_call_stack=>get_call_stack( ).
      DATA(formatted_call_stack) = cl_abap_get_call_stack=>format_call_stack( unformatted_call_stack ).
      DATA(structure_formatted_call_stack) = cl_abap_get_call_stack=>format_call_stack_with_struct( unformatted_call_stack ).
    ENDFORM.