SAP — Select rows
SAP — Select rows
Section titled “SAP — Select rows”Type: sap-select-row · Package: SAP Activities v1.0.5
Selects rows in an SAP ALV grid, just like a person marking them before pressing a button that acts on the chosen rows (release, delete, show details, export only the selection…).
How it works
Section titled “How it works”Waits for SAP to finish whatever it is processing, finds the grid by its selector and leaves exactly the rows in rows selected. The selection replaces any existing one: rows not in the list end up unselected.
Rows are numbered from 0 (the first row is 0). You can give several separated by commas, and ranges with a hyphen, for example "0,3,5-8".
It only works on ALV grids (GridView). If the selector points to another type of control, the activity fails and says so: on a classic table (table control), a row is selected by writing to its selection column with SAP — Set cell.
If the grid is not on the screen yet, the activity waits for it up to the configured limit (timeout or the scope’s elementTimeout, 30 seconds by default).
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
selector | selector | — | The ALV grid. Captured selector or SAP id, for example wnd[0]/usr/cntlGRID1/shellcont/shell. |
rows | string | — | Rows (0-based), comma-separated. Ranges allowed: "0,3,5-8". |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanSapSession | — | SAP session. Omit it inside the body of an SAP — Attach or SAP — Log on. |
timeout | number | — | Seconds to wait for the grid to appear. Overrides the scope’s elementTimeout. Empty uses the scope value (30 by default); 0 fails on the first try. Decimals allowed. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Only works on an ALV (GridView). On a classic table a row is selected by writing to its selection column with sap-set-cell. | The selector does not point to an ALV grid. Use SAP — Set cell on classic tables. |
| SAP GUI error when setting the rows | rows doesn’t have the expected format or includes rows that don’t exist. |
Component '…' does not exist in the SAP session. Waited … s for it to appear. The current screen is … dynpro … (transaction …). … | The element did not appear in time. The message says which screen the session is on: it is almost always a different one than expected (a dialog in front, a step that didn’t happen). If the screen is slow, raise timeout. |
Plus the errors common to all activities.
Example
Section titled “Example”Select the first three rows of the result and press a button on the ALV toolbar:
SAP — Select rows selector = "wnd[0]/usr/cntlGRID1/shellcont/shell" rows = "0-2"SAP — ALV toolbar selector = "wnd[0]/usr/cntlGRID1/shellcont/shell" button = "&DETAIL"Select a row computed in the flow:
SAP — Select rows selector = "wnd[0]/usr/cntlGRID1/shellcont/shell" rows = str(index)Related activities
Section titled “Related activities”- SAP — Read table — read the grid to decide which rows to select.
- SAP — ALV toolbar — press a button that acts on the selected rows.
- SAP — Set cell — write into a cell (and select rows in classic tables).