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

cl_alv_event_data->m_data - Feed Stack Error

Former Member
0 Likes
3,817

Dear SDNers,

I implemented F4 in ALV. After selecting value from F4, user will go to next screen. Again if user went back to the initial screen and trying to select value from F4, double click going to dump.

Here is the code. Please help me

TYPES: BEGIN OF onf4_event_parameters_type.
     TYPES: c_fieldname     TYPE lvc_fname.
     TYPES: cs_row_no       TYPE lvc_s_roid.
     TYPES: cr_event_data   TYPE REF TO cl_alv_event_data.
     TYPES: ct_bad_cells    TYPE lvc_t_modi.
     TYPES: c_display       TYPE char01.
     TYPES: END OF onf4_event_parameters_type.

     DATA: f4_params TYPE onf4_event_parameters_type.


CLEAR:f4_params.
     f4_params-c_fieldname = e_fieldname.
     f4_params-cs_row_no = es_row_no.
     f4_params-cr_event_data = er_event_data.
     f4_params-ct_bad_cells = et_bad_cells.
     f4_params-c_display = e_display.



FIELD-SYMBOLS <itab> TYPE lvc_t_modi.
     DATA: ls_modi TYPE lvc_s_modi,
           ls_f4_itab TYPE f4_itab_type.



     ASSIGN f4_params-cr_event_data->m_data->* TO <itab>.
     ls_modi-row_id = f4_params-cs_row_no-row_id.
     ls_modi-fieldname = f4_params-c_fieldname.

     READ TABLE f4_itab INTO ls_f4_itab INDEX es_row_no-row_id.
     ls_modi-value = ls_f4_itab-value.
*    append ls_modi to lt_tab.
     APPEND ls_modi TO <itab>.



first time it is working fine. But next time when i came back to first screen again from second screen, this double click event giving dump.


Please help me.


Regards,

Venkat


1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
3,314

Be careful when you describe the error : you've got the error "FREED STACK error" (not feed stack)

It means that you created a reference to a local variable, so the reference is freed when the procedure is left, as the local variable doesn't exist anymore.

12 REPLIES 12
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,314

Did you forget the


er_event_data->m_event_handled = gc_true.

at end of the handling method?


Regards,

Raymond

Read only

0 Likes
3,314

Dear Raymond,

No, i am using this as well. Still

Read only

0 Likes
3,314

Guys,

Any clue i will get?

Read only

0 Likes
3,314

Either provide detail of dump (export/attach) or check execution of statements in the method (sy-subrc on ASSIGN and APPEND)

Read only

0 Likes
3,311

Dear Raymond,

Here is the code where dump is coming

ASSIGN f4_params-cr_event_data->m_data->* TO <itab>. ( Here sy-subrc getting failed)
     ls_modi-row_id = f4_params-cs_row_no-row_id.
     ls_modi-fieldname = f4_params-c_fieldname.

     READ TABLE f4_itab INTO ls_f4_itab INDEX es_row_no-row_id.
     ls_modi-value = ls_f4_itab-value.
     APPEND ls_modi TO <itab>.


First time it is working as i mentioned above



Once i went to next screen->came to first screen again-> used f4 -> selected value and double clicked.


Now



Here assingig value to field symbol. Where sy-subrc is 4 and giving dump saying  Field symbol has not yet been assigned.


Hope it is clear.Please let me know if you need any more information and help me.

Read only

0 Likes
3,311

Here i got a clue that when i called another screen and going back to intial screen, i m clearing the container.

Here i wrote code like below to clear container.

IF g_custom_container IS NOT INITIAL.
     CALL METHOD g_custom_container->free.
     CLEAR:g_custom_container.
     FREE:g_custom_container.
   ENDIF.



Is it because of clearing my container, i am facing this issue. If yes, please let me know

Read only

0 Likes
3,311

Can I get any clue?

Read only

0 Likes
3,311

If you free the parent container, you may be required to free also the ALV grid inside?

Read only

0 Likes
3,311

Dear Raymond,

I am clearing both parent container and grid as well. Please find below.

    CALL METHOD g_grid->refresh_table_display.
     CLEAR: g_grid.
     FREE : g_grid.
     CALL METHOD g_custom_container->free.
     CLEAR:g_custom_container.
     FREE:g_custom_container.



Still same error.

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,315

Be careful when you describe the error : you've got the error "FREED STACK error" (not feed stack)

It means that you created a reference to a local variable, so the reference is freed when the procedure is left, as the local variable doesn't exist anymore.

Read only

0 Likes
3,311

Sorry. it is FREED STACK.

Please let me know the solution to clear this error

Regards

Venkat

Read only

0 Likes
3,311

Thank you Sandra,

Issue solved. I re-declared variables globally and issue got solved..

Regards,

Venkat