sapgui_set_property

Method and Property Functions

Sets the property of a SAP object.

int sapgui_set_property( const char *control_id, const char *property_name, const char *new_value, [args,] LAST );
control_idObject ID Strings
property_name The name of the SAP GUI Object Properties to set
new_value The value to set property_name
argsOptional Arguments
LAST A marker indicating the end of the argument list. Not required if Optional Arguments are used.

The sapgui_set_property function sets the specified property property_name, with the value new_value, in the SAP object with the identification number control_id.

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_set_property to set the text within the command window to "dwdm". The script then verifies the text by retrieving it using sapgui_get_property and writing to a parameter ParamName1.

Action() {
sapgui_select_active_window("wnd[0]");
sapgui_set_property(
    "tbar[0]/okcd", "text", "dwdm", 
    LAST );
// Verification - not recorded function
sapgui_get_property("tbar[0]/okcd", "text", 
    "ParamName1", LAST );
   //Output is "dwdm"
lr_output_message(lr_eval_string("{ParamName1}"));
return 0;
}