Share this page

# sapgui_table_set_checkbox

Table Functions

Selects or clears a checkbox inside a table cell.

    int sapgui_table_set_checkbox( const char *description, const char *tableID, const char *row, const char *column, const char *newValue, [args,] LAST );

description | User entered text to aid in understanding script
tableID | Object ID Strings
row | Row number. The first data row is numbered zero (0). If there is a header row it is numbered (-1).
column | Column number. The first column is numbered zero (0).
newValue | "True" or "False"
args | Optional Arguments
LAST | A marker indicating the end of the argument list. Not required if Optional Arguments are used.

sapgui_table_set_checkbox sets the state of a checkbox in a table. If newValue is "True" the box is selected. If newValue is "False" it is cleared.

## 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_table_set_checkbox to select, then clear a checkbox.

Copy code

    /*Click on "Visible/Hidden" checkbox to select it */
    sapgui_table_set_checkbox("(0, 'Invisible')",
        "usr/tblRSDEMO02TC_COLS",
        "0",
        "15",
        "True",
        BEGIN_OPTIONAL,
            "OriginalState=False",
            "AdditionalInfo=sapgui1048",
        END_OPTIONAL);
    /* Now check the status. Output is "Selected" */
    if (sapgui_table_is_checkbox_selected("Is box Selected?",
        "usr/tblRSDEMO02TC_COLS", // Table ID
        "0", // First row
        "15", // Sixteenth column
        LAST)
    )
        lr_output_message("Selected");
    else
        lr_output_message("Not Selected");
    /*Click again on check box to clear it */
    sapgui_table_set_checkbox("(0, 'Invisible')",
        "usr/tblRSDEMO02TC_COLS",
        "0",
        "15",
        "False", LAST );
    /* Now check the status. Output is "Not
    Selected" */
    if (sapgui_table_is_checkbox_selected("Is box Selected?",
        "usr/tblRSDEMO02TC_COLS",
        "0",
        "15",
        LAST)
    )
        lr_output_message("Selected");
    else
        lr_output_message("Not Selected");

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: