Share this page

# sapgui_send_vkey

General Object Functions

Emulates user striking key on keyboard.

    int sapgui_send_vkey( const char *key, [args,] LAST );

key | A number in quotes or a predefined constant.
args | Optional Arguments
LAST | A marker indicating the end of the argument list. Not required if Optional Arguments are used.

The sapgui_send_vkey function emulates the keyboard by sending a virtual key.

The argument key can be a number or one of the following constants:

CONSTANT | VALUE
ENTER | "0"
HELP | "1"
F2 | "2"
BACK | "3"
F4 | "4"
CANCEL | "12"
PAGEUP | "81"
PAGEDOWN | "82"

## 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_send_vkey to send a keyboard "ENTER".

Copy code

    // Enter the Command
    sapgui_set_ok_code("me51n", // the command
        BEGIN_OPTIONAL,
            "AdditionalInfo=info1022",
        END_OPTIONAL);
    //Press ENTER to run the command
    sapgui_send_vkey("0",
        BEGIN_OPTIONAL,
            "AdditionalInfo=info1023",
        END_OPTIONAL);

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: