sapgui_set_property_of_active_object

Method and Property Functions

Sets a property of the active object.

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

The sapgui_set_property_of_active_object function sets the specified property property_name, of the current active object with the value new_value. The current object is selected with sapgui_active_object_from_parent_method or sapgui_active_object_from_parent_property.

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_active_object_from_parent_method to select the 5th row within a table. The row's selected property is then set to true using sapgui_set_property_of_active_object.

Action() {
// Connect to R/3 server, and log on
sapgui_open_connection("My Connection", "con[0]");
sapgui_select_active_session("ses[0]");
sapgui_logon("MyUserName", "MyPassword", "800",
    "EN", LAST );
sapgui_select_active_window("wnd[0]");
// Selecting 5-th row on "Basic personal data" tab
sapgui_set_property(
"shellcont/shell/shellcont[0]/shell/shellcont[1]/shell[1]",
    "HierarchyHeaderWidth", "251", LAST );
sapgui_active_object_from_parent_method(
"usr/tabsMENU_TABSTRIP/tabpTAB01/ssubSUBSCR_MENU:SAPMP50A:0400/subSUBSCR_ITMENU:SAPMP50A:0310/tblSAPM/P50ATC_MENU",
    "getAbsoluteRow", "5", LAST );
sapgui_set_property_of_active_object("selected", "True", 
    LAST );
// Now verify the set property
sapgui_get_property_of_active_object("selected", 
    "ParamName2", LAST );
lr_output_message(lr_eval_string("Status bar text = {ParamName2}"));
return 0;
}