Example: sapgui_grid_select_rows

The following example uses sapgui_grid_select_rows to select a single row, a list of rows, and a range of rows.

// Save the Grid ID in variable "GridID"
lr_save_string
    ("usr/cntlBCALVC_TOOLBAR_D100_C1/shellcont/shell",
    "GridID");
// Select first row
sapgui_grid_select_rows("One row", 
        "{GridID}", 
        "0", 
        BEGIN_OPTIONAL, 
            "AdditionalInfo=sapgui1023", 
        END_OPTIONAL);
sapgui_grid_clear_selection("", "{GridID}", LAST );
// Select three rows listed explicitly
sapgui_grid_select_rows("Three rows listed", 
        "{GridID}", 
        "1,3,5", 
        LAST );
sapgui_grid_clear_selection("", "{GridID}", LAST );
// Select rows with combination of list and range syntax
sapgui_grid_select_rows("Six rows, listed and range", 
        "{GridID}", 
        "1,2,6-9",
        LAST );