Adding checkboxes to columns
In this recipe, we will see how we can display checkboxes in a column in the ALV output. The user may select a checkbox and switch it on or off. Then, based on his or her selection, a button may be pressed and function executed. The primary emphasis of this recipe will be the display of checkboxes within a column and the coding to set it as on or off.
Getting ready
For this recipe, we will make a copy of the simple ALV program that was created in the beginning of the chapter. We will then add the checkbox-related coding to this copy.
How to do it...
For adding a checkbox column to your ALV program, follow these steps:
Add a new field
CHECKBOX
to the typeTY_PA0008
defined in your program. The position of the field will determine the position of this column in the ALV display. We will place it at the end.Then, use the
get_column
method to get access to theCHECKBOX
column. We will set the long , medium, and short texts of this column asCheckbox
. The most important...