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
/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?/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.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:
Result of GET_CALL_STACK
:
PROGRAM_INFO
(100 characters)
/A\
"CONT
block of the ABAP Load, as can be seen in the ABAP statement LOAD REPORT), separated by backslash (e.g. \20180413155837\2128\
EVENT_INFO
(100 characters)
/A\
"REPOSRC-UDAT
and REPOSRC-UTIME
) and two unknown numbers used to determine the eventual local class name (possibly the index of the TRIG
block line of the ABAP Load), separated by backslash (e.g. \20180413155837\00033\9\
)MODULE_INFO
(20 characters)
Result of FORMAT_CALL_STACK
(lines of type STRING):
LOCAL_CLASS_NAME_30=>INTERFACE_NAME_30~METHOD_NAME_30
)Result of FORMAT_CALL_STACK_WITH_STRUCT
(lines with 6 components):
STACK_DEPTH
(integer)KIND
(30)
PROGNAME
(40): main programINCLUDENAME
(40): include programLINE
(integer)EVENT
(61): event/Procedure (name of event, function module, method, subroutine)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.