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: 

Read variables from higher-level stack programs or use them! Dirty Assign?

0 Kudos

data: it_abap_callstack type abap_callstack.
data: it_syst_callstack type sys_callst.

    call function 'SYSTEM_CALLSTACK'

      exporting

        max_level    = 20

      importing

        callstack    = it_abap_callstack

        et_callstack = it_syst_callstack.



I try to get the data from the local table like this:

       field-symbols: <fs_table> type any table.

       assign ('(FBICRC003_DATA_REC)LT_SEL[]') to <fs_table>.


But the table is not assigned, could anyone help me out?

2 REPLIES 2

0 Kudos

the stack looks like that:

18 METHOD IF_EX_FB_RC_PRESENTATION~PROCESS_CUSTOMER_UI_FUNCTIONS ZCL_IM_FB_RC_PRESENTATION=====CP ZCL_IM_FB_RC_PRESENTATION=====CM00E
17 METHOD IF_EX_FB_RC_PRESENTATION~PROCESS_CUSTOMER_UI_FUNCTIONS CL_EX_FB_RC_PRESENTATION======CP CL_EX_FB_RC_PRESENTATION======CM006
16 METHOD BADI_PROCESS_CUST_UI_FUNCTIONS CL_FBRC_PRESENTATION==========CP CL_FBRC_PRESENTATION==========CM00T
15 METHOD HANDLE_FUNC_GUI_TOOLBAR CL_FBRC_PRESENTATION==========CP CL_FBRC_PRESENTATION==========CM007
14 METHOD DISPATCH CL_GUI_TOOLBAR================CP CL_GUI_TOOLBAR================CM007
13 METHOD DISPATCH CL_GUI_CFW====================CP CL_GUI_CFW====================CM001
12 FORM CONTROL_END SAPFGUICNTL_CFW SAPFGUICNTL_CFW
11 FORM CONTROL_END SAPFGUICNTL SAPFGUICNTL
10 FORM %_CTL_END SAPMSSYD SAPMSSYD
9 MODULE (PAI) %_CTL_END SAPLFB_RC_SERVICES <SYSINI>
8 PAI MODULE %_CTL_END
7 PAI SCREEN 0300 SAPLFB_RC_SERVICES
6 FUNCTION FB_RC_START_UI SAPLFB_RC_SERVICES LFB_RC_SERVICESU15
5 FORM MAIN FBICRC003_DATA_REC FBICRC003_DATA_REC_F04
4 EVENT START-OF-SELECTION FBICRC003_DATA_REC FBICRC003_DATA_REC

Sandra_Rossi
Active Contributor

You can't access local data only by using this methodology (only global data). A workaround is to use the Enhancement Framework, by defining a global field symbol (for instance named <ZZ_GT_SEL> in program FBICRC003_DATA_REC, and assign LT_SEL to it at the beginning of the procedure where LT_SEL is defined, then use assign ('(FBICRC003_DATA_REC)<ZZ_GT_SEL>') to <fs_table>.

PS: of course, before doing the latter assign, you have made sure that the procedure declaring the local data object (MAIN of FBICRC003_DATA_REC) exists in the call stack, otherwise a short dump would occur.