Show TOC

Displaying Field Contents as CheckboxesLocate this document in the navigation structure

Use

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
          
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:

The checkbox fields for flag2 and flag3 are filled because their first position is "X". The user can change the contents of the checkboxes with a mouse click.