Share this page

# sapgui_get_ok_code

Verification and Data Retrieval Functions

Retrieves the Command field text.

    int sapgui_get_ok_code( const char *outParamName, [args,] LAST );

outParamName | Script parameter to store the retrieved value.
args | Optional Arguments
LAST | A marker indicating the end of the argument list. Not required if Optional Arguments are used.

The sapgui_get_ok_code data retrieval function gets the text in the Command field. The Command field is the box at the left of the first toolbar of the main window.

## Return Values

This function returns LR_PASS (0) on success or LR_FAIL (1) on failure.

## Parameterization

Parameterization is not applicable to this function.

## Example

The following example uses sapgui_get_ok_code to retrieve the command into "CommandBoxText".

Copy code

    //Insert the command "/ndwdm" into the Command field.
    sapgui_set_ok_code("/ndwdm",
            BEGIN_OPTIONAL,
                "AdditionalInfo=sapgui1011",
            END_OPTIONAL);
    sapgui_get_ok_code("CommandBoxText", LAST );
    // Output is "Command String = /ndwdm"
    lr_output_message(
        "Command String = %s",lr_eval_string("{CommandBoxText}"));
    sapgui_send_vkey(ENTER, LAST );
    sapgui_get_ok_code("CommandBoxText", LAST );
    // Output is empty string: "Command String = "
    lr_output_message(
        "Command String = %s",lr_eval_string("{CommandBoxText}"));

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: