Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

copy button in ALV cl_gui_alv_grid

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

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.

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

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.

0 Kudos

could you please specify where i can write this code, as the button is not created by me, it is alv toolbar button.

0 Kudos

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.

Former Member
0 Kudos

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.