Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Find if object is on the stack

Former Member
0 Likes
477

Hi,

With the kind of code below, is it possible to discover if (SAPLM61X)MDPSX[] is actually on the stack before calling the assign? If it isn't on the stacknot, the ASSIGN always falls over.

LV_MDPSX_NAME = '(SAPLM61X)MDPSX[]'.

ASSIGN (LV_MDPSX_NAME) TO <MDPSX>.

Thanks,

William

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
432

Check this code


DATA l_i_callstack TYPE sys_callst.
DATA l_var_functionname(70) TYPE c.

FIELD-SYMBOLS <l_callstack> TYPE LINE OF sys_callst.

CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
et_callstack = l_i_callstack.

READ TABLE l_i_callstack ASSIGNING <l_callstack>
WITH KEY eventtype = 'FUNC'.
IF sy-subrc EQ 0.
MOVE <l_callstack>-eventname TO l_var_functionname.
ENDIF.

The code above mentioned has been found in this forum, few months ago.

Whether this will help you ?

Hi,

With the kind of code below, is it possible to discover if (SAPLM61X)MDPSX[] is actually on the stack before calling the assign? If it isn't on the stacknot, the ASSIGN always falls over.

LV_MDPSX_NAME = '(SAPLM61X)MDPSX[]'.

ASSIGN (LV_MDPSX_NAME) TO <MDPSX>.

Thanks,

William

1 REPLY 1
Read only

former_member194669
Active Contributor
0 Likes
433

Check this code


DATA l_i_callstack TYPE sys_callst.
DATA l_var_functionname(70) TYPE c.

FIELD-SYMBOLS <l_callstack> TYPE LINE OF sys_callst.

CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
et_callstack = l_i_callstack.

READ TABLE l_i_callstack ASSIGNING <l_callstack>
WITH KEY eventtype = 'FUNC'.
IF sy-subrc EQ 0.
MOVE <l_callstack>-eventname TO l_var_functionname.
ENDIF.

The code above mentioned has been found in this forum, few months ago.

Whether this will help you ?