sapgui_set_collection_property

Method and Property Functions

Sets the property of a object of type SAP GuiCollection.

int sapgui_set_collection_property( const char *control_id, const char *property_name, char *arg1, ..., char *argn, [optionalArgs,] LAST );
control_idObject ID Strings
property_name The name of the SAP GUI Object Properties to set
arg1...argn Property values to be set.
optionalArgsOptional Arguments
LAST A marker indicating the end of the argument list. Not required if Optional Arguments are used.

The sapgui_set_collection_property function sets the specified property property_name, with the list of string items arg1...argn which make up the GuiCollection object.

To read the property of a GuiCollection object, use sapgui_get_property, which returns the string items in the form string1,string2,...,stringn.

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_collection_property to set the selected columns in the grid control to CITYFROM and CITYTO.

Action() {
//Load the sample
sapgui_set_ok_code("/ndwdm", LAST );
sapgui_send_vkey(ENTER, LAST );
sapgui_tree_select_item(
    "Grid demo with menu button & detail grid, REPTITLE", 
    "shellcont/shell", 
    "000740", 
    "REPTITLE", LAST );
sapgui_tree_double_click_item(
    "Grid demo with menu button & detail grid, REPTITLE", 
    "shellcont/shell", 
    "000740", 
    "REPTITLE", LAST );
// Grid control: Select "CITYFROM" and "CITYTO" columns
sapgui_set_collection_property(
     "usr/cntlBCALVC_TOOLBAR_D100_C1/shellcont/shell",
     "SelectedColumns", 
     "CITYFROM", "CITYTO", LAST );
sapgui_call_method(
     "usr/cntlBCALVC_TOOLBAR_D100_C1/shellcont/shell",
     "PressToolbarButton", "&SORT_DSC", "LAST");
return 0;
}