2009 Sep 16 6:35 AM
Hi
In my alv i have made one field as editable..when i edit the field and click save button the control comes to below code.
CALL METHOD gro_grid->get_selected_rows
IMPORTING
et_index_rows = gwa_selected_rows.
*Through the index capturing the values of selected rows
LOOP AT gwa_selected_rows INTO gv_selected_rows.
READ TABLE git_data INTO gwa_data INDEX gv_selected_rows-index.
here git_data is the internal table given to alv grid...i nthe above read stmt..gwa_data gives the value in field as old one..its not capturing the new value..how to solve this ..pls help
2009 Sep 16 6:37 AM
Hi Ganesh,
Use this.
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
Hi
In my alv i have made one field as editable..when i edit the field and click save button the control comes to below code.
CALL METHOD gro_grid->get_selected_rows
IMPORTING
et_index_rows = gwa_selected_rows.
*Through the index capturing the values of selected rows
LOOP AT gwa_selected_rows INTO gv_selected_rows.
READ TABLE git_data INTO gwa_data INDEX gv_selected_rows-index.
here git_data is the internal table given to alv grid...i nthe above read stmt..gwa_data gives the value in field as old one..its not capturing the new value..how to solve this ..pls help
2009 Sep 16 6:37 AM
Hi Ganesh,
Use this.
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
2009 Sep 16 7:05 AM
Hi,
Use event data_changed.
When 'SAVE' is pressed, call check_changed_data( ) which will trigger event data_changed.
Inside handler method copy the modified cells to table.
*PAI
When 'SAVE'.
g_o_grid->check_changed_data( ). " It triggers event 'data_changed'.
LOOP AT g_t_modcells INTO g_r_modcells. " Loop at modified cells table
READ TABLE git_data INTO gwa_data INDEX g_r_modcells-row_id . " <---- Ur code
.......
ENDLOOP.
clear: g_t_modcells[],g_t_modcell[].
*Declare data for handler method.
Data: g_t_modcells type lvc_t_modi,
g_t_modcell type lvc_t_modi.
*Declare handler method for event 'data_changed'.
METHODS: data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
*Handler method implementation
METHOD data_changed.
IF er_data_changed->mt_good_cells[] IS NOT INITIAL.
g_t_modcell[] = er_data_changed->mt_good_cells[].
APPEND LINES OF g_t_modcell TO g_t_modcells. " Modified cells are copied to table g_t_modcells[]
ENDIF.
ENDMETHOD.
Thanks,
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |