Selecting Cells, Rows and Columns
You are able to use your application to determine which areas are selected when the ALV output is being displayed. In the simple, two-dimensional table and hierarchical-sequential list, you are also able to change whether and under what conditions users are able to select areas of the ALV output. To do this, use the selection type in list-type ALV outputs. In tree structures, you determine whether each individual node or item can be selected or not.
The current cell indicates the position of the cursor in the simple, two-dimensional table and the hierarchical-sequential list. The current cell is highlighted differently from the selected cells. In this way you are able to recognize the current cell when you are in a selected area.
You can make the following settings for the selection in the ALV output:
· Get settings for selection and information on the selected areas
· Set selection type
· Enable selection of nodes and items
· Select area
The method GET_SELECTIONS that returns the selection object exists in each main ALV class. With this object, you get the desired information with various getter methods.
Methods
Function |
Class |
Method |
Get selection object |
CL_SALV_TABLE CL_SALV_HIERSEQ_TABLE CL_SALV_TREE |
GET_SELECTIONS |
Get a selection object for a hierarchy level |
CL_SALV_HIERSEQ_LEVEL |
GET_SELECTIONS |
With the selection type, you set which cells users are able to select simultaneously, that is, whether and how they can combine the selections. The selection type has different effects in the various display types.
Display type ALV Tool |
Classic ABAP list |
Full screen |
In the Container |
Simple, two-dimensional table |
Yes |
Yes |
Yes |
Hierarchical-sequential list |
Yes |
|
|
Tree structure |
|
No |
No |
The following selection types are available:
· NONE
· SINGLE
· MULTIPLE
· ROW_COLUMN
· CELL
The following table shows which selection type you have to assign to the ALV output to enable users to execute the desired function.
Required Selection Type
Desired Function |
Classic ABAP List |
Full
screen |
Select individual column |
NONE |
NONE |
Select individual row |
SINGLE |
NONE |
Select individual cell |
NONE |
CELL |
Select
multiple cells |
Not possible |
CELL |
Select
one or multiple rows and |
SINGLE |
MULTIPLE ROW_COLUMN CELL |
Provide pushbutton or checkbox to select rows |
SINGLE |
ROW_COLUMN CELL |
Methods
Function |
Class |
Method |
Set Selection Type |
CL_SALV_SELECTIONS |
SET_SELECTION_MODE |
Get selection type |
GET_SELECTION_MODE |
In the tree structure, you can determine whether the user is allowed to select individual nodes or items.
Display type ALV Tool |
Classic ABAP list |
Full screen |
In the Container |
Simple, two-dimensional table |
No |
No |
No |
Hierarchical-sequential list |
No |
|
|
Tree structure |
|
Yes |
Yes |
Methods
Function |
Class |
Method |
Set selectability of the item |
CL_SALV_ITEM |
SET_ENABLED |
Check whether the item can be selected |
IS_ENABLED |
|
Markierbarkeit des Knotens festlegen |
CL_SALV_NODE |
SET_ENABLED |
Check whether the node can be selected |
IS_ENABLED |
You are able to set selections in the ALV output using your application.
Display type ALV Tool |
Classic ABAP list |
Full screen |
In the Container |
Simple, two-dimensional table |
Yes |
Yes |
Yes |
Hierarchical-sequential list |
Yes |
|
|
Tree structure |
|
Yes |
Yes |
Methods
Function |
Class |
Method |
Set current cell |
CL_SALV_SELECTIONS |
SET_CURRENT_CELL |
Get current cell |
GET_CURRENT_CELL |
|
Select cells |
SET_SELECTED_CELLS |
|
Get selected cells |
GET_SELECTED_CELLS |
|
Select rows |
SET_SELECTED_ROWS |
|
Get selected rows |
GET_SELECTED_ROWS |
|
Select columns |
CL_SALV_SELECTIONS CL_SALV_SELECTIONS_TREE |
SET_SELECTED_COLUMNS |
Get selected columns |
GET_SELECTED_COLUMNS |
|
Select node |
CL_SALV_SELECTIONS_TREE |
SET_SELECTED_NODES |
Get selected nodes |
GET_SELECTED_NODES |
|
Select item |
SET_SELECTED_ITEM |
|
Get selected item |
GET_SELECTED_ITEM |