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:

  1. Add a new field CHECKBOX to the type TY_PA0008 defined in your program. The position of the field will ...

Get SAP ABAP Advanced Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.