Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Stored Procedure in Crystal Report

Dear Experts,

I have created one Stored Procedure where Baseentry of invoice is the parameter. Now want to design a crystal report based on that. How to proceed? Please guide stpwise. I am using ODBC connection. And in Crystal report also the parameter should be the baseentry. How to integrate?


Akash A.

Former Member
Former Member replied

Hi Akash,

Using a Stored Procedure in Crystal

And with that little introduction, we finally get to the point of this articleu2014using stored procedures to simplify data queries for Crystal. Although we canu2019t make the above query into a database view, we can incorporate it into a stored procedure that returns a result set and then feed that stored procedure into Crystal no differently than we would feed a query based on views or tables.

Since stored procedures are so different between Oracle and SQLServer, weu2019ll first show you how to use a stored procedure in Crystal, given that it is already created. Then, weu2019ll separately show you how to create the procedure in SQLServer and Oracle.

When creating a Crystal Report, make it like any other report, except for the following.

1. When specifying a data source, instead of selecting Tables or Views, select Procedures, and then select the newly created procedure.

2. Crystal will immediately prompt you to enter values for the procedureu2019s input parameters. Do NOT do so; rather, check u201CSet as Nullu201D and click OK so Crystal will know to prompt for these as input parameters each time the report is run.

3. If you are using SQLServer, click on the Field Explorer and rename the fields to remove the u201C@u201D prefix that Crystal automatically adds to conform to SQLServer parameter/variable naming conventions. (This is not necessary if you are using Oracle.)

Then finish the report as you normally would. In our example, since all of the hard work was done in the query embedded inside of the stored procedure, the work in Crystal is trivial.

or check



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question