Share this page

# Example: sapgui_select_radio_button

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");

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