Displaying Field Contents as Checkboxes 

You can output the first character of a field as a checkbox on the output screen by using the following syntax:

Syntax

WRITE <f> AS CHECKBOX.

If the first character of field <f> is an "X", the checkbox is displayed filled. If the first character is SPACE, the checkbox is displayed blank.

In other words, the user can fill or clear them with a mouse click. For information on how you can check if output fields are ready for input or not, see Enabling Fields for Input. Fields that are ready for input are an essential component of interactive lists that allow a dialog with the user (see Interactive Lists.

DATA: flag1(1) TYPE c    VALUE ' ',
      flag2(1) TYPE c    VALUE 'X',
      flag3(5) TYPE c    VALUE 'Xenon'.

WRITE: / 'Flag 1 ', flag1  AS CHECKBOX,
       / 'Flag 2 ', flag2  AS CHECKBOX,
       / 'Flag 3 ', flag3  AS CHECKBOX.

This produces the following output list:

For FLAG2 and FLAG3, the checkboxes are filled because the first character of these fields is "X". The user can change the contents of the checkboxes with a mouse click.