Show TOC Entering content frame

Background documentation Selecting Rows Locate the document in its SAP Library structure

You can use the selection type to affect whether the user can select rows and how many he or she can select at once. This also defines whether a lead selection exists (see Lead Selection in Structure linkContext Node: Properties).

Note

The user can also change the selection of rows in a write-protected ALV output as long as the selection type allows this. However, if you deactivate the ALV output, the user cannot select any rows, regardless of the selection type (see Write-Protection and Activation).

Setting the Selection Type

You can use the following selection types:

·        Automatic

The settings are adopted from the context mode.

·        No selection possible (NONE)

No pushbuttons for selecting rows are displayed at the start of the rows.

·        Single row (SINGLE)

Pushbuttons are displayed at the start of rows. The user can only select a single row. This row is displayed as the lead selection. If a user selects another row, the lead selection is changed too.

·        Single rows without lead selection (SINGLE_NO_LEAD)

Pushbuttons are displayed at the start of rows. The user can only select a single row. If a user selects another row, the selection is changed too. The ALV output has no lead selection.

·        Multiple rows (MULTI)

Pushbuttons are displayed at the start of rows. The user can use the CTRL key to select multiple rows. The first selected row is the lead selection.

·        Multiple rows without lead selection (MULTI_NO_LEAD)

Pushbuttons are displayed at the start of rows. The user can use the CTRL key to select multiple rows. The ALV output has no lead selection.

Caution

You use the property SELECTION of your context node to specify the number of data records that can be selected.

Example: If you choose the value 1..1 for the SELECTION, one entry only must always be selected. The value 0..n means that it is possible to select no entries at all, but also to select as many as required.

You can never use the selection type to allow the selection of more entries than the number defined in the context node. If you try to do this, you receive a run-time error and the application terminates.

Example: If you made the SELECTION 1..1 in the context node, you may not use the selection types MULTI and MULTI_NO_LEAD.

To define the selection type, use the methods of the interface class IF_SALV_WD_TABLE_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Selection Type Methods

Function

Method

Set selection type

SET_SELECTION_MODE

Get selection type

GET_SELECTION_MODE

Event Handling

In the case of the selection types that allow the user to change the lead selection, the event ON_LEAD_SELECT can be used (see ON_LEAD_SELECT).

 

Leaving content frame