09-22-2009 8:02 AM
Hi Experts,
I have developed a ALV program using "REUSE_ALV_GRID_DISPLAY" function module that will give edit option for particular fields and user will edit the fields and save the entry, then it will reflect in the database table.
Problem is: when i changed any entry in the ALV output, if i save directly after edition it is not getting reflected in the internal table but if i double click the entry then it is getting reflected in the internal table.
i found some forums like "need to refresh the ALV" , i have done using
selfield-refresh = 'X'.
selfield-col_stable = 'X'.
selfield-row_stable = 'X'.
but it is not reflected,
Can anyone guied me how to acheive the result.
Expected result: After changed any entry, if i save the entry without double clicking, it should get reflected in the internal table.
Thanks in advance
Vijay.R
09-22-2009 8:05 AM
Hi Vijay,
Use this in Interactive section even if you are doing simple ALV.
DATA:
lv_ref_grid TYPE REF TO cl_gui_alv_grid.
CLEAR : gv_tcode.
*-- to ensure that only new processed data is displayed
IF lv_ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref_grid.
ENDIF.
IF NOT lv_ref_grid IS INITIAL.
CALL METHOD lv_ref_grid->check_changed_data.
ENDIF.
THis will solve your problem.
Regards,
Vijay
09-22-2009 8:05 AM
Hi Vijay,
Use this in Interactive section even if you are doing simple ALV.
DATA:
lv_ref_grid TYPE REF TO cl_gui_alv_grid.
CLEAR : gv_tcode.
*-- to ensure that only new processed data is displayed
IF lv_ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref_grid.
ENDIF.
IF NOT lv_ref_grid IS INITIAL.
CALL METHOD lv_ref_grid->check_changed_data.
ENDIF.
THis will solve your problem.
Regards,
Vijay
09-22-2009 8:09 AM
Hi
Try in this way
In Sy-ucomm, when you click the SAVE button, call the method like this.
WHEN 'SAVE'.
DATA w_ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = w_ref1.
CALL METHOD w_ref1->check_changed_data.
CALL METHOD w_ref1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
This will help u...
09-22-2009 8:12 AM
09-22-2009 9:29 AM
Hi, I think you should use a method : CHECH_CHANGED_DATA before updating any table. This method you will find in class CL_GUI_ALV_GRID. CALL METHOD grid->check_changed_data IMPORTING E_VALID = l_valid1. where l_valid1 is of type c.