Share this page

# sapgui_grid_select_columns

Grid Functions

Selects one or more columns in a grid.

    int sapgui_grid_select_columns( const char *description, const char *gridID, char *arg1, ..., char *argn, [optionalArgs,] LAST );

description | User entered text to aid in understanding script
gridID | Object ID Strings
arg1...argn | A list of Grid column identifiers. The list must be terminated with either an optional arguments clause or with LAST. Grid column identifier: The column identifier string is inserted in the script during recording. This string is the field name defined in the SAP data dictionary. This identifier cannot be replaced with a column number.
optionalArgs | Optional Arguments
LAST | A marker indicating the end of the argument list. Not required if Optional Arguments are used.

sapgui_grid_select_columns selects one or more columns in a grid control. The columns do not have to be adjacent. They do not have to be passed to the function in the order in which they appear in the grid.

The column listmust be terminated even if only one column ID is passed.

To select only one column, you can also use sapgui_grid_select_column.

## Return Values

This function returns LR_PASS (0) on success or LR_FAIL (1) on failure.

## Parameterization

You can parameterize all string (char type) arguments.

## Example

The following example uses sapgui_grid_select_columns to select one, two and three columns.

Copy code

    // Store the Grid ID in a variable
    lr_save_string
        ("usr/cntlBCALVC_TOOLBAR_D100_C1/shellcont/shell",
        "GridID");
    sapgui_grid_select_columns("Select One Column",
            "{GridID}",
            "CONNID",
            LAST );
    sapgui_grid_select_columns("Select two columns",
            "{GridID}",
            "CONNID", "CITYFROM", //Select two columns
            BEGIN_OPTIONAL,
                "AdditionalInfo=sapgui1019",
            END_OPTIONAL);
    sapgui_grid_select_columns("Select three non-adjacent columns",
            "{GridID}",
            "CONNID", "CARRID", "CITYFROM", LAST );

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: