callFunction
Invoke an ABAP function module by name with parameter values and receive its results, return code, and row counts. Validates inputs first; executes on target system and rolls back unless commit is set.
Instructions
Call a function module with values and get what it returned, as data. Takes the module name alone - the function group is looked up - reads its signature, generates the call and runs it through a throwaway class in $TMP. The answer carries the exporting, changing and tables parameters by name, sy-subrc turned back into the name of the classic exception it stood for, a class-based exception with its text, and the true row count of every table. Values are checked against the signature before anything is sent: an unknown parameter name and a missing mandatory one are refused with the list of what the module takes. IMPORTANT: this executes the module on the target system as the connected user. Nothing it changed is kept - the call is followed by ROLLBACK WORK - unless commit is set, and a module that commits internally cannot be taken back at all. It counts as a writing tool and is refused in read-only mode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Function module, e.g. Z_APP_GET_INVOICE. The group is found by search. | |
| commit | No | Keep what the call did: COMMIT WORK AND WAIT instead of ROLLBACK WORK. Default false. Ask before setting this on a module that posts. | |
| dryRun | No | Return the generated class source without touching the system - the way to see what would run. | |
| values | No | Values by parameter name: {"IV_LGNUM": "101", "IT_ITEMS": [{"MATNR": "4711"}]}. A structure is an object, a table an array; a scalar can be a string, a number or a boolean. Only importing, changing and tables parameters can be supplied. | |
| maxRows | No | Rows of each table kept in the answer, default 20. The true count is reported either way. | |
| keepClass | No | Leave the generated class on the system instead of deleting it. Default false. | |
| snippetClass | No | Name for the throwaway class. Default ZMCP_CALL_<timestamp in base 36>. | |
| functionGroup | No | The group, when the search does not find the module. |