2012 Apr 09 9:50 AM
Hi Folks,
I have built an editable ALV using object oriented approach. when i change data and press SAVE button directly, i can capture the changes by using the method CALL METHOD g_grid->refresh_table_display..
But after changing the data, if i press enter and then press SAVE button, changed data is not captured into my internal table.
Could any body suggest whats the problem.
Thanks,
Shyam.
Moderator Message: There are many discussions on this topic, please search. Thread locked.
Message was edited by: Suhas Saha
2012 Apr 09 10:58 AM
Hi.
Please try comparing your code with the code given in the below wiki link and see if there are any discrepancies.
2012 Apr 09 11:34 AM
Hi,
use method check_changed_data of CL_GUI_ALV_GRID.
like,
take one more itab if required to compare.
data itab_old type standart table of <table>
itab_old[] = itab[].
lr_grid->set_table_for_first_display( .......... ).
when SAVE.
lr_grid->check_changed_data( ).
if itab_old[] <> itab[]
Update Database.
endif.
Hope this helps u.,
Thanks & Regards,
Kiran.
2012 Apr 16 8:38 AM
To make the ALV column as editable in runtime we need to set the field EDIT as part of
field catalog generation.
base table we need to handle the event HANDLE_DATA_CHANGED of the class
CL_GUI_ALU_GRID this event is triggered enter key in the modified cell.
the method REGISTER_EDIT_EVENT of a class CL_GUI_ALV_GRID.
MT_GOODS_CELLS which are of type LVC_T_MODI. It is table type associated with the structure LVC_S_MODI.
row id, field name, and value.
this is some sample which includes all the functionality PFA