04-18-2017 11:45 AM
I have a non editable alv created using OOps abap, now when i click on copy button a new line appears which is non editable,i want to make it editable, how to do that.
04-18-2017 12:20 PM
Define the grid as editable, add a field of type lvc_t_styl to your internal table, fill it with values cl_gui_alv_grid=>mc_style_disabled or enabled to set the readiness for input.
04-18-2017 12:20 PM
Define the grid as editable, add a field of type lvc_t_styl to your internal table, fill it with values cl_gui_alv_grid=>mc_style_disabled or enabled to set the readiness for input.
04-18-2017 12:29 PM
could you please specify where i can write this code, as the button is not created by me, it is alv toolbar button.
04-18-2017 12:38 PM
Inital setup in the method that create the grid (before the set_table_for_first_display) then handle the event before/after_user_command. Use before if you want to add the record yourself (use set_user_command to space to prevent standard function behavior), use after if you want to identify and update the added (last) record.
04-18-2017 12:36 PM
Hi shruti,
there are many document about this in the internet.
https://wiki.scn.sap.com/wiki/display/Snippets/ALV+-+Editable+grid+control
https://wiki.scn.sap.com/wiki/display/Snippets/Disable+or+Enable+Input+fields+Conditionally+In+ALV
04-18-2017 3:49 PM
Thank you for your help.
I have created an enter event using(write teh code after
'set_table_for_first_display'
CALL METHOD v_alv->register_edit_event
EXPORTING
* i_event_id = cl_gui_alv_grid=>mc_evt_modified
i_event_id = cl_gui_alv_grid=>mc_evt_enter
EXCEPTIONS
error = 1
OTHERS = 2.
which triggers data_changed event of cl_gui_grid_display, and according to the entries in table er_data_changed, created ok codes using
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'INS'.
and coded for the ok codes in user command of the screen.