‎2010 Jan 18 6:30 PM
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 ).
‎2010 Jan 18 7:22 PM
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
‎2010 Jan 18 7:22 PM
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
‎2010 Jan 18 8:23 PM
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.
‎2010 Jan 18 9:48 PM
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