Skip to Content
0
Former Member
Apr 24, 2007 at 08:23 AM

Editable ALV problem

180 Views

Hello Gurus !!

I have implemented (displayed ) editable ALV using

set_table_for_first_display

. Requirement is whenever user edit changes and click on save button , the appropriate changeds should be saved in table.

Please suggest ur answers 😊 .

The code is given below :-

**********************FOR EDITABLE ALV**********************

DATA :g_grid TYPE REF TO cl_gui_alv_grid,

g_custom_container TYPE REF TO cl_gui_custom_container,

gs_layout TYPE lvc_s_layo,

g_max type i value 100,

METHOD EDITABLE_ALV.

IF g_custom_container IS INITIAL.

CREATE OBJECT g_custom_container

EXPORTING container_name = 'ALV_EDIT'.

CREATE OBJECT g_grid

EXPORTING i_parent = g_custom_container.

*§1.Set status of all cells to editable using the layout structure.

gs_layout-edit = 'X'.

select * from ZSAC_EDIT into table gt_outtab up to g_max rows.

CALL METHOD

g_grid->set_table_for_first_display

EXPORTING i_structure_name = 'zsac_edit'

is_layout = gs_layout

i_bypassing_buffer = space

  • is_variant = ws_f_grid_disvar

  • i_save = ws_c_grid_save

CHANGING it_outtab = gt_outtab.

CALL METHOD g_grid->set_ready_for_input

EXPORTING i_ready_for_input = 1.

ENDIF.

what code shouild I write when user click on save button :----

case sy-ucomm.

WHEN 'SAVE'.

???????????????????????

ENDCASE.

Points will be rewarded for helpful answers

😊 .

Thanks in advance :-).

Sachin