Skip to Content
0

copy button in ALV cl_gui_alv_grid

Apr 18, 2017 at 10:45 AM

116

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Raymond Giuseppi
Apr 18, 2017 at 11:20 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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.

0
avatar image
Former Member Apr 18, 2017 at 11:36 AM
0
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 18, 2017 at 02:49 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded