Application Development 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: 

Get the value of a field dynamically using system_callstack

Former Member
0 Kudos

Hi Gurus...

My requirement is to get the value of a field used in a program which is available in my call stack while debugging.

I am using FM system_callstack but it just gives an internal table comprising of 3 fields programname, event type and event name.

I do not know how to retrieve the value of a variable being used in one of the programs.

My sample code is

CALL FUNCTION 'SYSTEM_CALLSTACK'

IMPORTING

et_callstack = l_cstack_tab. " internal table

READ TABLE l_cstack_tab INTO l_cstack_wa INDEX 4.

IF sy-subrc = 0 AND l_cstack_wa-progname IS NOT INITIAL.

l_evt_class = l_cstack_wa-progname.

              • then what shud I do.*********************

ENDIF.

Please help.

1 ACCEPTED SOLUTION

Former Member

Hi,

Try using an external assign the read the call stack, e.g.

data: lv_name(30) type c,
       lv_lgbkz    type lvs_lgbkz.
 field-symbols: <fs> type any.


 lv_name = '(SAPLL03A)I_MLVS-LGBKZ'.
 assign (lv_name) to <fs>.
 if ( <fs> is assigned ).
...............
endif.

Where the value in lv_name is the program and variable name from the call stack.

Regards,

Darren

3 REPLIES 3

Former Member

Hi,

Try using an external assign the read the call stack, e.g.

data: lv_name(30) type c,
       lv_lgbkz    type lvs_lgbkz.
 field-symbols: <fs> type any.


 lv_name = '(SAPLL03A)I_MLVS-LGBKZ'.
 assign (lv_name) to <fs>.
 if ( <fs> is assigned ).
...............
endif.

Where the value in lv_name is the program and variable name from the call stack.

Regards,

Darren

0 Kudos

Hi Darren,

Thanks for the reply.

I am somehow not able to understand your solution. I will again explain my issue. I alraedy have the name of the program which I need to use at runtime.

The issue is that this program has the structure filled with data and I need this data at run time in another program so I am using the FM System_callstack. Using this I get the name of the program dynamically but how do I read this structure data.

I hope I am clear.

Please help.

Thanks,

Neha

Former Member
0 Kudos

Thank you. It was a good solution.