# Help with CData SAPERP RFC parameters

**URL:** <https://community.cdata.com/t/help-with-cdata-saperp-rfc-parameters/696>\
**Category:** CData Drivers\
**Tags:** question, ssis, sap-erp\
**Created:** [April 18, 2024, 2:25pm UTC](https://community.cdata.com/t/help-with-cdata-saperp-rfc-parameters/696 "2024-04-18T14:25:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbaptista](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@cbaptista](https://community.cdata.com/u/cbaptista)\
**Post date:** [April 18, 2024, 2:25pm UTC](https://community.cdata.com/t/help-with-cdata-saperp-rfc-parameters/696/1 "2024-04-18T14:25:28Z")

</div>

Hello everybody!

I’m facing the following situation when trying to execute an RFC trought CData connector for SAP ERP…

In SAP, I’ve created an RFC to retrieve additional data for our needs, it works and have these parameters:

 ![10a9254e-bfc8-4e96-810b-490ce88156fd.png](https://us1.discourse-cdn.com/cdata/original/1X/b809cf2d22916147a028aebcfe0d8487ce464e3c.png)

The PT\_DOCNUM has the following structure:

 ![25276c95-c546-4f92-ae28-1488a4293fa9.png](https://us1.discourse-cdn.com/cdata/original/2X/5/5e6d17e83efe622c8326888659d92dfe20d50d5c.png)

It receives a list of documents and fiscal years to further processing as input in PT\_DOCNUM. The returning data is in CT\_DATA.

According to this page ([CData SSIS Components for SAP ERP - Provider Schema](https://cdn.cdata.com/help/RYJ/rssis/pg_datamodel.htm)) I can call the function trough EXEC statement.

I’m using SSIS inside Visual Studio 2019 to achieve this step. The test flow is as follows (Using the CData Source component):

 ![3b5ad5fc-debe-40ec-8c34-6b9da189f05c.png](https://us1.discourse-cdn.com/cdata/original/2X/a/abe204c95567f620f29898dd443b410c8263701b.png)

The first attempt was to fill the DOCS#TEMP table and execute the RFC in the same call:

 ![aade3b7f-da1e-4124-84f6-05fa632397df.png](https://us1.discourse-cdn.com/cdata/original/2X/0/0a0a79e52e2dd9d49fadbfe94c0d89ddf75f27ba.png)

When I execute the above, the RFC is called but no parameter is received on the function (PT\_DOCNUM headerline and table are both empty):

 ![8632d6c3-a2ca-4eba-9dcb-dfcbfd9ef600.png](https://us1.discourse-cdn.com/cdata/original/2X/d/d25f618469a07646262bcadd8ed70cca78e1f339.png)

The second approach, If I use the static JSON command to pass the values it works, for example:

 ![aa407568-f659-44c4-a3d3-7c2b624baa70.png](https://us1.discourse-cdn.com/cdata/original/1X/06d032df6088adae099ccdd355aa37568a87bc81.png)

Data is retrieved with a bottom line including only the parameters:

 ![beadba83-5e07-4709-ad74-0183fa2e67de.png](https://us1.discourse-cdn.com/cdata/original/2X/f/fc85406258f1abf1512a4bb79b73cbc4d191d09e.png)

I tried to use different components like the CData SAPERP Lookup, no avail. And I also tried to put out of the dataflow, by using CData Tasks in the control flow:

 ![cfba32e0-90fb-4b80-8a33-6906331b64db.png](https://us1.discourse-cdn.com/cdata/original/1X/682cf2023f4f3317ac03eaba535d770353210ff6.png)

Where the first task selects the data and saves into the DOCS#TEMP table and the second task EXECs using the temp table, also it doesn’t work…

Task 1:

 ![4811b3fd-f01e-479a-8965-35a6c6cb6909.png](https://us1.discourse-cdn.com/cdata/original/2X/0/071da9e5061710d33a394bfc06863bbe196d2806.png)

Task 2:

 ![f29fc873-e91a-47f4-9983-ae32301fdcdd.png](https://us1.discourse-cdn.com/cdata/original/2X/d/dc3b629a5ebfda2d12ef925abf281e5ef91ed09e.png)

So my question is: How can I use the CData (or other SSIS components) to pass the result of a SELECT into a temporary table as the parameter for na EXEC call?

---

<div class="post-metadata">

**Author:** ![Luçjano\_Capo](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/lu%C3%A7jano_capo/32/1638_2.png) [@Luçjano\_Capo](https://community.cdata.com/u/Lu%C3%A7jano_Capo)\
**Post date:** [April 19, 2024, 3:41pm UTC](https://community.cdata.com/t/help-with-cdata-saperp-rfc-parameters/696/2 "2024-04-19T15:41:41Z")

</div>

Hi @cbaptista ,

You might want to explore the **ResultSet** section as a potential solution. Here is what I mean by that. In this scenario, I’m demonstrating the utilization of the Sharepoint provider, specifically with a stored procedure named **DownloadAttachment** , which requires two parameters:

1. File →&nbsp;The path of the file to be saved.
2. RemoteFile →&nbsp;The path of the file on the server. This can be the full URL or simply the file name. If you use the name of the file, the latest version is downloaded.

Consider this SQL Query →&nbsp;SELECT URL FROM Files WHERE Name=‘Account.csv’

By executing this query, I extract the value from the URL column in Sharepoint and designate it as the **RemoteFile** parameter.

Visualize the following flow:

 ![5586e7c2-1cd1-473e-bf08-3f26f82d6456.png](https://us1.discourse-cdn.com/cdata/original/1X/b5f0cbb41b7b9392bdc98345e6fff91d67da2b70.png)

In the first Task, I have utilized the following properties:

- SQLSourceType →&nbsp;Direct Input
- Command Type →&nbsp;Command Text
- SQLStatement →&nbsp;SELECT URL FROM Files WHERE Name=‘Account.csv’ (Considering that this query yields a single result in my particular scenario)
- ResultSet →&nbsp;Single Row (reflecting the fact that only one record is expected)

 ![d01703de-6e9e-4809-a1b3-3f79b9bbbc56.png](https://us1.discourse-cdn.com/cdata/original/2X/2/21e2feb5bdc21ef7e5954e58e9a2a58680fef2de.png)

In the **Result Set** &nbsp;section, I’ll establish a variable called&nbsp; **User::URL** :

 ![c4af899d-61bc-4c6e-b682-e4f73c2a3646.png](https://us1.discourse-cdn.com/cdata/original/1X/a2ed3b4fd47d9822f9a0ed124b8c971c2f8dc671.png)

As for the second Task, I have utilized these properties:

- SQLSourceType →&nbsp;Direct Input
- Command Type →&nbsp;Stored Procedure
- SQLStatement →&nbsp;[CData].[REST].[DownloadAttachment]&nbsp;(this is the name of the procedure which I was able to select from the dropdown list)

 ![4825763d-f659-4b70-8b9d-2e8c86bac520.png](https://us1.discourse-cdn.com/cdata/original/1X/29188156486fc2c179e909854efbe437d8ee9d7b.png)

In the **Parameter Mapping** section, I’ve linked the _Parameter Name_ **RemoteFile** &nbsp;to the value of **User::URL** retrieved from the previous section. (Additionally, I’ve assigned a local variable called&nbsp; **File\_Name** to the **File** _Parameter Name_ in this example.)

 ![5855b23e-578a-4a50-940b-0418a22e91ed.png](https://us1.discourse-cdn.com/cdata/original/2X/b/b5ac798ebe192e98a36d01fcb0ad41e795e63be8.png)

Upon saving these configurations, you can go ahead and start the process and your stored procedure will get successfully executed.

If the Stored Procedure doesn’t appear in the drop-down list, you can utilize the following format:

 ![3bfd85b0-800d-4173-87fe-d3d555278cd9.png](https://us1.discourse-cdn.com/cdata/original/1X/0bb837efcbc8d4899bdad073bb1e66a0a76b7932.png)

In the **Parameter Mapping** section (please ensure to use the correct Parameter Name in this case):

 ![16124bf0-5273-4086-a5cd-839b322f8809.png](https://us1.discourse-cdn.com/cdata/original/1X/48ade0288671ea457d4baa22addc634aa20bf13d.png)

This example should guide you in utilizing the stored procedure as needed. The distinction in your case lies in utilizing two parameters simultaneously, necessitating the addition of another parameter in the **Result Set** section when employing the query → SELECT DOCNUM, GJARH FROM ZVBW\_NFDOC WHERE CREDAT \>= format(getdate(),‘01.MM.yyyy’) AND CREDAT \<= format(getdate(),‘dd.MM.yyyy’)

Kindly keep in mind that you can execute one Stored Procedure at the time.&nbsp;Therefore, if the result obtained from this query exceeds one, adjustments to your flow are necessary. For instance, you can implement a For/ForEach Loop to execute the Stored Procedure for each set of values obtained from the Result Set. Additionally, you would need to change the ResultSet from Single Row to Full ResultSet to accommodate multiple records.
