sapgui_call_method_ex
| Method and Property Functions |
Invokes a method of a SAP object and saves the return value as a parameter.
int sapgui_call_method_ex( const char *control_id, const char *method_name, const char *outputParamName, void *arg1, ..., void *argn, [optionalArguments] LAST);
| control_id | Object ID Strings |
| method_name | The name of the SAP function to invoke |
| outputParamName | The parameter in which to store the return value of the call. |
| arg1...argn | Arguments to the method |
| optionalArguments | Optional Arguments |
| LAST | A marker indicating the end of the argument list. Not required if Optional Arguments are used. |
The sapgui_call_method_ex function identifies the SAP object with the SAP identifier control_id, and calls the object's method method_name. It passes to the method the actual arguments arg1...argn. The return value of the invoked method is stored in parameter outputParamName.
The return value can be a simple value or a GuiCollection Array.
In some cases, VuGen generates an additional argument, AdditionalInfo.
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
In this example, the first child of a TreeView root has two sub children, "Item1" and "Item2". sapgui_call_method_ex invokes the SAP method, GetSubNodesCol.
sapgui_call_method_ex("usr/cntlTREE_CONTAINER/shellcont/shell",
"GetSubNodesCol",
"MySubNode",
"Child1", LAST );After the call, parameter MySubNode_1 contains the string "Item1", parameter MySubNode_2 contains the string "Item1" and parameter MySubNode_count is equal to "2".

