sapgui_select_radio_button

General Object Functions

Selects a radio button.

int sapgui_select_radio_button( const char *description, const char *buttonID, [args,] LAST );
description User entered text to aid in understanding script
buttonIDObject ID Strings
argsOptional Arguments
LAST A marker indicating the end of the argument list. Not required if Optional Arguments are used.

sapgui_select_radio_button selects one radio button in a group and clears all other buttons in the group

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_select_radio_button to select a radio button, then select a different button in the same group.

/* Selects the "Blue" radio button from a group of colors */
sapgui_set_focus("usr/radRB7",LAST );
sapgui_select_radio_button("Blue", 
    "usr/radRB7", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1027", 
    END_OPTIONAL);
// Confirm the button state. Output is "Button is set"
if (sapgui_is_radio_button_selected("Confirm State of Blue button", 
        "usr/radRB7", 
        LAST)
    )
        lr_output_message("Button is set");
    else
        lr_output_message("Button is not set");
// Change from Blue to Yellow 
sapgui_set_focus("usr/radRB4",LAST );
sapgui_select_radio_button("Yellow", 
    "usr/radRB4", LAST );
// Confirm the Blue button state. Output is "Button is not set"
if (sapgui_is_radio_button_selected("Confirm State of Blue button", 
        "usr/radRB7", // Id of Blue button
        LAST)
    )
        lr_output_message("Button is set");
    else
        lr_output_message("Button is not set");
// Confirm the Yellow button state. Output is "Button is set"
if (sapgui_is_radio_button_selected("Confirm State of Yellow button", 
        "usr/radRB4", // ID of Yellow Button
        LAST))
        lr_output_message("Button is set");
    else
        lr_output_message("Button is not set");