Share this page

# sapgui_press_button

General Object Functions

Clicks on a push button.

    int sapgui_press_button( const char *description, const char *buttonID, [args,] LAST );

description | User entered text to aid in understanding script
buttonID | Object ID Strings
args | Optional Arguments
LAST | A marker indicating the end of the argument list. Not required if Optional Arguments are used.

sapgui_press_button emulates a user clicking on button buttonID.

## 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.

## Examples

### Example 1

The following example uses sapgui_press_button to open the Business Workplace from the main screen.

Copy code

    sapgui_press_button
        ("SAP Business Workplace (Ctrl+F12)",
        "tbar[1]/btn[36]", // Button ID
        BEGIN_OPTIONAL,
            "AdditionalInfo=info1020",
        END_OPTIONAL);

### Example 2

The following example uses sapgui_press_button to click the OK button next to the Command box.

Copy code

    sapgui_press_button("Enter", "tbar[0]/btn[0]", LAST );

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: