Example: sapgui_is_radio_button_selected

The following example uses sapgui_is_radio_button_selected to confirm the successful selection of a radio button, then confirm change of the selection.

/* Select the "Blue" radio button from a group of colors */
sapgui_set_focus("usr/radRB7", LAST );
// Click the button
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");