08-22-2016 7:39 AM
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
08-23-2016 6:57 AM
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.
08-22-2016 7:50 AM
Did you forget the
er_event_data->m_event_handled = gc_true.
at end of the handling method?
Regards,
Raymond
08-22-2016 8:02 AM
08-22-2016 8:59 AM
08-22-2016 9:21 AM
Either provide detail of dump (export/attach) or check execution of statements in the method (sy-subrc on ASSIGN and APPEND)
08-22-2016 9:34 AM
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.
08-22-2016 10:08 AM
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
08-23-2016 6:43 AM
08-23-2016 1:52 PM
If you free the parent container, you may be required to free also the ALV grid inside?
08-29-2016 8:55 AM
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.
08-23-2016 6:57 AM
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.
08-23-2016 1:48 PM
Sorry. it is FREED STACK.
Please let me know the solution to clear this error
Regards
Venkat
08-29-2016 10:08 AM
Thank you Sandra,
Issue solved. I re-declared variables globally and issue got solved..
Regards,
Venkat