sapgui_table_is_column_selected

Table Functions

Checks whether a table column is selected.

int sapgui_table_is_column_selected( char *tableID, char *column, [args,] LAST );
description User entered text to aid in understanding script
tableIDObject ID Strings
column Column number. the first column is numbered zero (0).
argsOptional Arguments
LAST A marker indicating the end of the argument list. Not required if Optional Arguments are used.

sapgui_table_is_column_selected returns True if the column is selected.

Return Values

This function returns True (-1) or False (0).

Parameterization

You can parameterize all string (char type) arguments.

Example

The following example uses sapgui_table_is_column_selected to determine which of the first thee columns is selected. For purposes of demonstration, the third column (column 2) is selected before running the check.

Copy code
static char tableID[] = "usr/tblRSDEMO02TC_SPFLI";
int isSelected;
int i;
char sSelected[7];
char colNum[2];
sapgui_table_set_column_selected("Depart.city", 
    tableID, 
    "2", 
    "True", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1035", 
    END_OPTIONAL);
        
for (i=0; i<4; ++i)
{
    colNum[0] = (char)(i + 48); 
    colNum[1] = '\0';
    isSelected= sapgui_table_is_column_selected(tableID,
        colNum);
    if (isSelected) 
        strcpy( sSelected, "is"); 
    else 
        strcpy( sSelected, "is not");
    lr_message("Column %d %s selected", 
        i, sSelected);
}
            
Example: Output:
Columns.c(30): Table - Selected column "Depart.city"
Notify: Table - Found column 0
Columns.c(42): Table - Column Airline carrier is unselected
Column 0 is not selected
Notify: Table - Found column 1
Columns.c(42): Table - Column Flight number is unselected
Column 1 is not selected
Notify: Table - Found column 2
Columns.c(42): Table - Column Depart.city is selected
Column 2 is selected
Notify: Table - Found column 3
Columns.c(42): Table - Column Dep. airport is unselected
Column 3 is not selected