Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Get the value of a field dynamically using system_callstack

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



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.*********************


Please help.

Former Member
Former Member replied


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 ).

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



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question