Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Execute RFC in the Source-to-Pay with SAP integration

Execute RFC from the available list.

Process flow:

Step 1 - Create a record for the SAP system in the Connection and Credential alias table.

Step 2 - Create Credential for connecting to the SAP system.

Step 3 - Add MID Server and credentials to the connection.

Step 4 - Create ERP Source is an ERP source configuration table.

Step 5 - Create a Service, add flow and give the necessary inputs in the fields.

Image omitted: rfc-execution.svg
Flowchart of 4 SAP setup steps in ServiceNow: Create Credential Alias, Connection Alias, Connection, and ERP Source Configuration.

Name: ZSN_BAPI_GET_DATA

TitleTypeDescription
Input
1Connection Alias -Connection Alias for SAP ECC – RFC
2RFCThe Reference to records \(SAP RFC Name and Application component\) in SAP RFC Table
3InputInput fields for the selected RFC, represented in a flat structure
Output
1ResponseThe response for the execution of selected RFC at SAP
2Action StatusIf the request is executed successfully, Status is set to “Success”. If there’s a failure in SAP ECC - RFC, Status is set to “Error"
3Error MessageReason for error. Populated only when an error occurs. Error returned from SAP in the RETURN parameter.No or empty response received from SAP
Image omitted: function-builder-initial-screen.png
SAP Function Builder initial screen for the ZSN\_BAPI\_GET\_DATA function module.
Image omitted: test-function-module.png
Function module test screen for entering the IMPORT, CHANGING, and TABLES parameters.
Image omitted: test-function-module-result-screen.png
Results data returned after executing the test function module.
Image omitted: structure-editor.png
Structure editor showing the results data structure.
Image omitted: structure-editor-display-it.png
Structure editor displaying the results data output.