In the last sample we have used the function tEcs.executeXql() to extract data from an SAP table. Now we will repeat the last sample to execute an SAP function using the function tEcs.executeFunction().

For all other basics please refer to the sample in Getting started with ECS Core and SharePoint Online. For this section the knowledge about the basic usage is assumed!

Let’s check the following demo function module on the SAP side: SD_RFC_CUSTOMER_GET.
We will set the input parameter NAME1 e.g. to X* .
The table CUSTOMER_T contains the result of 5 entries.



For this sample we would repeat all the steps of the sample Getting started. We will only change the JavaScript code in Step 3 to call the SAP function.

Step 3: Add Javascript code for SAP connectivity

As you can you see below in the JavaScript code, the method tEcs.executeFunction() is used to call the SAP function module SD_RFC_CUSTOMER_GET. The input will be set to the parameter NAME1. The result is displayed using the the table CUSTOMER_T .


Deploy the project an run the App. You should have the following result: