Skip to main content

Run BAPI / function

Run a BAPI or remote-enabled function module with import values (structures as dictionaries) and table rows; returns exports, tables, changing values and the RETURN messages. Fails on error messages (type E or A) unless told otherwise.

Command in the SAP BAPI toolkit · id ooa.sap_bapi/call_function · 10 inputs (1 required), 8 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
FunctionStringYesFunction module or BAPI name.
ImportsDictionaryNoImport parameters: {"MATERIAL": "100-100", "HEADDATA": {"MATERIAL": "X"}}.
TablesDictionaryNoTable parameters: name to a Table or a list of dictionaries (one per row).
ChangingDictionaryNoChanging parameters.
CommitBooleanNofalseRun BAPI_TRANSACTION_COMMIT (wait) right after a successful call.
Fail on errorBooleanNotrueStop with SAP_BAPI.FAILED when RETURN has an error (type E or A); the call is rolled back.
SessionStringNosapSession name; one SAP logon per session.
Return tableStringNoA table parameter to return on its own as Table.
Return structureStringNoAn export or changing structure to return on its own as a dictionary.
Return fieldStringNoOne value to return on its own: an export field, or STRUCTURE-FIELD.

Outputs​

OutputTypeWhat it is
tableTableWith return_table: that table parameter after the call, on its own.
structureDictionaryWith return_structure: that export or changing structure, on its own.
valueAnyWith return_field: that one value (an export field, or STRUCTURE-FIELD).
exportsDictionaryExport parameters (structures as dictionaries, tables as Tables).
tablesDictionaryEvery table parameter after the call, as Tables.
changingDictionaryChanging parameters after the call.
messagesListBAPI RETURN messages (type, id, number, message).
successBooleanTrue when no RETURN message has type E or A.