Entering content frame

Background documentation Assigning Properties to Columns and Cells Locate the document in its SAP Library structure

You can assign most of the properties that affect the appearance of columns in the ALV output in the following two ways:

·        You assign the property to the entire column.

Each cell in the column then receives this property.

·        In another field in each cell, you define information on how the cell in question is to appear in the current column. You then assign this field to the current column.

This allows you to assign the required properties to cells individually.

You can assign the following properties like this:

·        Background color of a column ((SET_CELL_DESIGN or SET_CELL_DESIGN_FIELDNAME)

·        Cell variant (SET_SELECTED_CELL_VARIANT or SET_SEL_CELL_VARIANT_FIELDNAME)

Cell Editor Properties

Some properties for the appearance of a cell are connected to the cell editor used in the cell. This means that the properties of the cell editor define how a column is displayed. The following is also true for these properties: They can be valid for all instances of the editor, or they can be overridden by information in another field.

Example

In a column, you use the cell editor BUTTON. This causes each cell to be displayed as a button. You want to hide some of the cells in this column.

Because visibility is a property of the button, and not of the column, you have to use a workaround to hide the cell:

·         You generate an object of the class CL_SALV_WD_UIE_BUTTON (for example, lr_button).

·         A different field (for example, BUTTON_VIS) contains information on the visibility of each cell  You assign this field to the button lr_button:

lr_button->set_visible_fieldname( ‘BUTTON_VIS’ ).

·         You then assign the button to the column (for example, lr_column) as a cell editor:

lr_column->set_cell_editor( lr_button ).

This means that the field BUTTON_VIS determines the cells of the column lr_column in which the button is visible.

Below are additional examples of properties that you assign using the cell editor:

·        Font type used in TEXT_VIEW (SET_DESIGN or SET_DESIGN_FIELDNAME)

·        Graphic for a selected toggle button (SET_CHECKED_IMAGE_SOURCE or SET_CHECKED_IMG_SRC_FIELDNAME)

·        Size of the progress bar in the ProgressIndicator (SET_PERCENT_VALUE or SET_PERCENT_VALUE_FIELDNAME)

·        And much more…

The possibilities for this procedure are highly dependent on which UI element the cell editor is handling.

 

Leaving content frame