Make CL_SALV_TABLE column editable?

11.6k Views Asked by At

I am displaying an ALV using CL_SALV_TABLE=>FACTORY where I want the user to be able to select a number of lines which then will be processed further.

I did turn the column into a checkbox column using CHECKBOX_COLUMN->SET_CELL_TYPE( IF_SALV_C_CELL_TYPE=>CHECKBOX ), but I did not find a way to make the column "editable", it is read-only.

Is there a way to get this to work with CL_SALV_TABLE? Everything i found so far are solutions for the old ALV-Functions

3

There are 3 best solutions below

0
On BEST ANSWER

SALV (ALV OM) does not offer any "edit" feature (search the Web for "International Editable SALV Day XXXX – Year XX", each year it's asking for this feature).

You may use CL_GUI_ALV_GRID instead.

NB: concerning CL_GUI_ALV_GRID, although the edit feature is widely used by standard programs, when it's about using it in custom programs, SAP don't offer any support in case the clients have issues using this edit feature (note 695910 - ALV Grid: Editable grid and methods that are not released).

0
On

Inside CL_SALV_TABLE builded on CL_GUI_ALV_GRID. You can get access to internal instance of CL_GUI_ALV_GRID and switch it to editable mode. There are several ways to get it, e.g.:

Then you can use SET_READY_FOR_INPUT method to switch in edit mode.

0
On

Not possible with CL_SALV_TABLE.

You will find an example how to do this with the function: REUSE_ALV_GRID_DISPLAY

The program is divided in different forms:

  1. get_data
  2. pf_status_set
  3. f_save_data
  4. f_delete_data
  5. user_command

In this example ist one column of the table SPFLI editable. You can edit and save the data. Furthermore, lines can also be deleted.

https://www.youtube.com/watch?v=ZzXHYDy0UUE