Application Development and Automation 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: 
Read only

Editable checkbox using CL_SALV_TABLE

Former Member
0 Likes
20,864

I have an ALV report and the first column is a checkbox. I am using class CL_SALV_TABLE to generate this report as a list display. I need to make the checkbox editable. The code below creates the checkbox but leaves it uneditable. I did not find a method in the cl_salv_columns_table that I could use.

call method cl_salv_table=>factory
    exporting
      list_display = 'X'
    importing
      r_salv_table = lr_table
    changing
      t_table      = gt_output.

  lr_columns = lr_table->get_columns( ).

  lr_column ?= lr_columns->get_column( 'CHECKBOX' ).
  lr_column->set_cell_type( if_salv_c_cell_type=>checkbox ).

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
10,925

You need to use the hotspot enabled checkbox IF_SALV_C_CELL_TYPE=>CHECKBOX_HOTSPOT. To refresh the value in the checkbox, you need to implement the event handler for the event LINK_CLICK.

You may read this blog post: http://help-abap.blogspot.com/2010/01/salv-table-14-editable-checkbox.html

Regards,

Naimesh Patel

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
10,926

You need to use the hotspot enabled checkbox IF_SALV_C_CELL_TYPE=>CHECKBOX_HOTSPOT. To refresh the value in the checkbox, you need to implement the event handler for the event LINK_CLICK.

You may read this blog post: http://help-abap.blogspot.com/2010/01/salv-table-14-editable-checkbox.html

Regards,

Naimesh Patel

Read only

0 Likes
10,925

Actually what I am looking for is SP01. As you can see the checkbox is part of the Spool no. field.

I did go through the link you provided but find it cumbersome. After click event, I will need to modify the content of the checkbox ( X or blank ) and then refresh the entire contents of the field. The SP01 screen seems to behave differently though.

Read only

0 Likes
10,925

For SP01, system uses the REUSE_ALV_LIST_DISPLAY or REUSE_ALV_GRID_DISPLAY FM to generate the output. It doesn't use the SAL OM to generate the ALV.

In SALV OM, I believe that's the only option to get the editable checkbox in the GRID (ALV generated with Container) / Fullscreen ALV. But you can get the selections (which brings the checkboxes) in the List display. Check the program SALV_DEMO_TABLE_SELECTIONS.

When you Run with selection "Output as List", you will get the editable checkboxes.

When you run the program with selection as "Output as Grid", you will get the "Box" icons for selection.

Regards,

Naimesh Patel