cancel
Showing results for 
Search instead for 
Did you mean: 

Using output parameters of a SQL stored procedure

Former Member
0 Kudos

Hello everyone

I have a problem with the output parameters of a SQL stored procedure. I have a SQL table with statistical data. One column is of type date. I want to create a Visual Composer application that displays some aggregated data depending on a selected time period. So I created a normal table that is connected to the result field of my table select stored procedure. I created an input form with two calendars where I can select a start date and an end date and connected the calendars to the input parameters of the table select stored procedure. Everything works fine until this point.

Now I want to improve the user friendliness and preselect the min max dates of my statistic table. I wrote a minmax stored procedure that calculates the min date and the max date of my statistic table and returns the two values as output parameters. When I add the minmax stored procedure as data service the output parameters are recognized as inout fields. When I connect these inout fields to my input form nothing is displayed. It seems that those min max values are not received.

Has anyone an idea why I cannot display these min max values?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Marc,

This same problem is also making me crazy....

I request to the SAP Gurus to come up with a solution.

Regards

Paresh

former_member193545
Active Participant
0 Kudos

Hi

Please check that the date passed from VC is compatible with the date field you are using in your DB, MSSQL uses a datetime field for all dates and time. Test your stored procedure as a stand alone and check what data you need, then check that VC passes the data in a way that is supported.

Jarrod Williams

Former Member
0 Kudos

Hi,

I allready set the output (inout) fields of my stored procedure to varchar(50) without success. Still nothing is displayed.

I extended my stored procedure so that it additionally calculates a normal min select statement and sets a return value. So I have three different types of information that are provided by my stored procedure and are recognized by the Visual Composer: the output (the return value of the stored procedure), the inout (the two output parameters minDate and maxDate) and the result (the min select statement). All three output types are connected to forms inside my Visual Composer IView: outputform, inoutform, resultform. Of course I connected the input plug of the data service to the start node and set the form fields visible. When I execute the IView then only the resultform displays a value (the result of the min select statement). The two other forms display empty fields (mindate, maxdate, return value).

I tested the stored procedure with the SQL Server Management Studio and with a small java application. In both cases I can read all three types of information.