HI,
To input value in ALV you have to make it editable.
to change values at runtime you have to capture some events and then change your values in internal table which is used to display alv.
Here is an example of editable ALV.
<b>REPORT ZWA_ALV_EDITABLE_FM . type-pools: slis. data: gs_layout type slis_layout_alv. DATA: d_ref TYPE REF TO data. DATA: itab type table of fmfint. SELECT * FROM fmfint INTO TABLE itab. gs_layout-edit = 'X'. * Call ABAP List Viewer (ALV) call function 'REUSE_ALV_GRID_DISPLAY' exporting i_callback_program = 'ZWA_ALV_EDITABLE_FM' i_callback_user_command = 'USER_COMMAND' i_structure_name = 'fmfint' is_layout = gs_layout tables t_outtab = itab. form user_command using r_ucomm type sy-ucomm rs_selfield type slis_selfield. if r_ucomm = '&DATA_SAVE'. message i000(SU) with 'saved'. MODIFY fmfint FROM TABLE itab. call function 'REUSE_ALV_LIST_DISPLAY' exporting i_structure_name = 'fmfint' tables t_outtab = itab. endif. endform.</b>
Regards,
Wasim Ahmed
Add a comment