
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.
Current Cell
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
Specify selection type
Enable Selection of Nodes and Items
Select Area
Get Information on Selections
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.
|
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 |
Specify selection type
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.
|
ALV Tool |
Display type |
Function available |
|
Simple, Two-Dimensional Table |
Classic ABAP List |
Yes |
|
Fullscreen |
Yes |
|
|
In the Container |
Yes |
|
|
Hierarchical-sequential list |
Classic ABAP List |
Yes |
|
Tree structure |
Fullscreen |
No |
|
In the Container |
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.
|
Function Required |
Classic ABAP List Hier.-Seq. List |
Fullscreen Container |
|
Selecting Specific Columns |
NONE |
NONE |
|
Selecting Single Rows |
SINGLE |
NONE |
|
Select individual cell |
NONE |
CELL |
|
Select multiple cells (with CTRL or shift key) |
Not possible |
CELL |
|
Select one or multiple rows and one or more columns (with CTRL key) |
SINGLE |
MULTIPLE ROW_COLUMN CELL |
|
Provide pushbutton or checkbox to select rows |
SINGLE |
ROW_COLUMN CELL |
|
Function |
Class |
Method |
|
Specify selection type |
CL_SALV_SELECTIONS |
SET_SELECTION_MODE |
|
Get selection type |
GET_SELECTION_MODE |
Enable Selection of Nodes and Items
In the tree structure, you can determine whether the user is allowed to select individual nodes or items.
|
ALV Tool |
Display type |
Function available |
|
Simple, Two-Dimensional Table |
Classic ABAP List |
No |
|
Fullscreen |
No |
|
|
In the Container |
No |
|
|
Hierarchical-sequential list |
Classic ABAP List |
No |
|
Tree structure |
Fullscreen |
Yes |
|
In the Container |
Yes |
|
Function |
Class |
Method |
|
Set selectability of the item |
CL_SALV_ITEM |
SET_ENABLED |
|
Check whether the item can be selected |
IS_ENABLED |
|
|
Set selectability of the node |
CL_SALV_NODE |
SET_ENABLED |
|
Check whether the node can be selected |
IS_ENABLED |
Select Area
You are able to set selections in the ALV output using your application.
|
ALV Tool |
Display type |
Function available |
|
Simple, Two-Dimensional Table |
Classic ABAP List |
Yes |
|
Fullscreen |
Yes |
|
|
In the Container |
Yes |
|
|
Hierarchical-sequential list |
Classic ABAP List |
Yes |
|
Tree structure |
Fullscreen |
Yes |
|
In the Container |
Yes |
|
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 |
|
|
Marking a Paragraph |
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 nodes |
CL_SALV_SELECTIONS_TREE |
SET_SELECTED_NODES |
|
Get selected nodes |
GET_SELECTED_NODES |
|
|
Select item |
SET_SELECTED_ITEM |
|
|
Get selected item |
GET_SELECTED_ITEM |