Using Stored Procedure Universe in Reports

Hi Friends,
I got some issues using SP's in Universe and WebI Report.
Case #1:
Can we execute dynamic SQL using stored procedure universe..?
I use SQL server as the DB for my reports.I created a SP which will execute on getting a input value from the user.This input value will frame the SQL dynamically in the SP.for executing the dynamic SQL i use sp_executesql inside the SP.The SP wexecutes successfuly in the DB but when i try executing it in the Universe i get a error message as follows: "Exception : DBD,[Microsoft][SQL SErver Native Client 10.0][SQL Server]Incorrect syntax  nesr 'FROM'.State:42000"
The script i used for creating SP for your reference:
CREATE PROCEDURE P_S_GetCodeValueList
          @s_table nvarchar(75)
as
begin
          declare @s_sqlCommand nvarchar(1000)
          declare @s_tablename nvarchar(75)
          declare @s_code nvarchar(75)
          set @s_tablename=@s_table
          set @s_code = '*'
          set @s_sqlCommand= 'SELECT ' + @s_code + ' FROM ' + @s_tablename
          exec sp_executesql @s_sqlCommand
end
Case #2:
AIl also tried creating reports using the SP Universe which needs to get the parameter when the user refesh the report.
But every time the report is refreshed the report fetches the data which was produced when the SP is executed in the Universe for the first time.
I need to get the prompt in the report , to which the user could give a value and the SP gets executed for that value.
Is there any option in BO to do this?
It will be very helpful if you could give me some work arounds on this.
Regards,
Sugumar

Hi Sugumar,
I can answer you for your 2nd question:
When you create the Stored procedure in the Universe and test it on retreiving data by inserting variable input you can check if the user could insert new value for the SP parameters.
Hope this helps!
Regards
Giuseppe

Similar Messages

  • How to use stored procedure in crystal report for eclipse

    Hi;
    I am working on crystal report for eclipse 2.0 and  trying to use stored procedure in report .It is created from Oracle but it is not showing any dependencies
    CREATE OR REPLACE procedure ACT_DB.getCostTransferDetails
            p_In_Contract_ID         varchar2 DEFAULT  '*',
            p_In_Status_ID           varchar2 DEFAULT  '*',
            p_In_COST_TRAN_DATE      varchar2 DEFAULT  '*',
            p_In_DEPT_ID             varchar2 DEFAULT  '*',
            p_In_PROJECT_ID          varchar2 DEFAULT  '*',
            p_In_EMPLOYEE_ID         varchar2 DEFAULT  '*',
            p_Out_CostTransfer_Cusor OUT COST_TRANSFER_PACKAGE.COST_TRANSFER_TYPE
    AS
    BEGIN    
            OPEN p_Out_CostTransfer_Cusor FOR
            SELECT
                header.cost_tran_id,
                header.cost_tran_date,
                header.total_credit_amount,
                header.total_debit_amount,
                header.transfer_status,
                header.updated_by,
                header.added_by,
                header.trf_over_ninety_days,
                header.business_unit_id,
                header.equip_approval,
                header.batch_desc,
                details.opr_unit_id,
                status.status_id,
                details.fund_code_id,
                details.prgm_code_id,
                details.class_id,
                details.activity_id,
                details.product_id,
                details.status_id,
                details.transaction_amount,
                details.jrnl_date,
                details.adjust_prcnt,
                details.adjust_amnt,
                details.details_equip_approval,
                details.detail_desc,
                details.account_id,
                details.project_id,
                details.dept_id,
                details.contract_id,
                details.reason_code_id,
                details.jrnl_id,
                employee.f_name,
                employee.l_name,
                employee.employee_id,
                project.project_id,
                project.project_status,
                --header.transfer_status,
                contracts.contract_desc 
              FROM header, details, status, employee, department, project, contracts
             WHERE     (header.cost_tran_id = details.cost_tran_id)
                    AND (header.cost_tran_date = details.cost_tran_date)
                    AND (header.transfer_status = status.status_id)
                    AND (department.dept_id = details.dept_id)
                    AND (department.dept_id = employee.dept_id)
                    AND (project.project_id = details.project_id)
                    AND (contracts.contract_id = details.contract_id)
                    AND (details.Contract_ID = p_In_Contract_ID OR p_In_Contract_ID ='*' )
                    AND (header.TRANSFER_STATUS = p_In_Status_ID OR p_In_Status_ID ='*' )
                    AND (TO_CHAR(details.COST_TRAN_DATE, 'MM/DD/YYYY') = p_In_COST_TRAN_DATE OR p_In_COST_TRAN_DATE ='*' )
                    AND (details.DEPT_ID  = p_In_DEPT_ID  OR p_In_DEPT_ID  ='*' )
                    AND (details.PROJECT_ID  = p_In_PROJECT_ID  OR p_In_PROJECT_ID  ='*' )
                    AND (header.ADDED_BY  = p_In_EMPLOYEE_ID  OR '*'=p_In_EMPLOYEE_ID  )
    Can any another way to make procedure
    Thanx
    Regards ,
    Amol

    Hi Amol,
    Are you able to execute your stored procedure from oracle?.
    - If "Yes" then use  the Crystal Report XIR2 Designer to create the report.
    - Import this report in the Crystal Report For Eclipse Workbench.
    - The latest version for Crystal Report For Eclipse is SP1.
    Please let me know the results.
    Thanks,
    Neeraj

  • Using stored procedures within Crystal Reports

    Hello all,
    Background Information:
    I am trying to teach myself how to execute a stored procedure within Crystal Reports.  This is an aspect of Crystal that my work group has not utilized before and we're trying to gather information on the subject.  We use Oracle to create and execute functions and procedures all the time, but I've never tried this within Crystal.
    I use the "Add Command" functionality within Crystal on most of my reports so that I can taylor the sql to the report.  I find this easier to do versus using the ODBC connection to the tables and writing the code through the Crystal Reports wizard.  I also frequently use functions within these sql statements that are inserted in the Add Command.
    What I'm trying to achieve:
    I have a report that needs to run as a "trial", and then later as a committed "run".  This is for a monthly billing system.  Essentially, the user will run the report as the "trial", preview the data, make any necessay corrections, and then later, run the actual billing run.  Within my application, the bills are not actually marked as "billed" until they are actually "billed', if that makes sense.  As a result, the "trial" report will need to mark the bills as "billed", generate the report, and then rollback the data (so that the bills are not "billed".  Once the actual billing reports are ran, the same report will run, but with a "commit" at the end of the report so that the bills are now "billed".
    I'm trying simple tests and failing (i.e. taking baby steps to learn what capabilities Crystal has):
    I created as simple of a procedure as I can envision.  This procedure inserts the word "test" in one of my fields for a provided account number.  When I try to run this procedure via Crystal (via New Report ->History->My ODBC Database link->Stored Procedures), Crystal asks for the account number parameter, as it should.  But I then receive the error message:
    Database Connector Error: '42000:[Microsoft][ODBC driver for Oracle]Syntax error or access violation'
    The existing ODBC connection has work great for years and years to retrieve data from tables, but this is the first time I've tried to utilize procedures.  Can anybody help?  And can anybody explain what the Stored Procedures link is supposed to do?  Am I going down the right path?
    thanks,
    Noel

    Hello,
    Make sure the Oracle client install path is in the PATH statement. And also make sure you are using an IN/OUT cursor. CR only reads the last SELECT statement. Search the Documents area on how to create a Stored Procedure.
    Also, if you are using CR XI ( 11.0 ) then upgrade to CR XI R2 and apply all service packs ( SP 6 ). Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    It may fix your issue also.
    Thanks again
    Don

  • Error creating Crystal Report using Stored Proc Universe

    Hi,
    I have created a stored procedure Universe, using the new feature available in XI R3.
    This connects to an Oracle database, executing a PL/SQL procedure returning ref cursor.
    I have created a WebI report using this Universe, which works fine and functions as expected.
    So there are no problems with either my Oracle stored proc or the Universe.
    However, I would like to create a Crystal report (2008) using the same Universe.
    I can create the report ok - using the SP Universe.
    When I attempt to refresh the data I get an error:
    Failed to retrieve data from the database.
    Details: ORA-06550: line 1, column 7:
    PLS-00103: Encountered the symbol "." when expecting one of the following:
    begin case declare etc etc
    .................................My Procedure ...................
    CREATE OR REPLACE PROCEDURE BIADM.Bo_Test_Report_R
    (Deposit_Cursor IN OUT SYS_REFCURSOR)
    IS
    BEGIN
    OPEN Deposit_Cursor FOR
    SELECT DISTINCT foracid "A/C"
    , acct_name "A/C Name", acct_opn_date "OP/Date", schm_code "SchmCode"
    FROM gam@finrpt
    WHERE acct_cls_flg ='N'
    AND foracid ='2252020145001';
    --AND cust_id ='CB2020145'
    END Bo_Test_Report_R;
    Please Give me solution as early as possible.
    Masud Iqubal

    Moved to Universe Design forum.

  • How to use optional prompts with stored procedure universe?

    Hi Experts,
    Iu2019m working on stored procedure universe in BO XI 3.0 SP2 FP2.5 with oracle at back end. My requirement is that I have to pass 5 optional prompts in the report and we have to pass these prompts through open document link. Please tell if this can be worked out on stored procedure universe?
    Thanks in advance.

    Hi,
    Try with OpenDoc syntax as follows.
    http://<servername>:<port>/OpenDocument/opendoc/<plat
    formSpecific>?iDocID=****&sIDType=CUID&sType=wid/rpt&lsM/lsS/lsRPROMPTNAME=[V1],[V2]&sDocName=reportname&sRefresh=Y/N
    where
    server name: cms server name
    port: portno
    <platformspecific>=: for java -> openDocument.jsp
                                      for .net -> opendocument.aspx
    idocid,sDocName & cuid -> we can get report properties ( goto info view -> select report -> right click -> properties i.e. doc id, cuid and report name)
    sType -> type of report i.e webi or deski ...
    lsS -> to pass single prompt value
    lsM -> to pass multiplle values to prompt
    lsR -> range of values ....
    Note: Here prompt name should be same as the one which we used in the report. Use + if there is blank space.
    Cheers,
    Suresh Aluri.

  • Why Dynamic Parameter is not working, when i create report using stored procedure ?

    Post Author: Shashi Kant
    CA Forum: General
    Hi all
    Why Dynamic Parameter is not working, when i create report XI using stored procedure ?
    Only i shaw those parameters which i used in my stored procedure, the parameter which i create dynamic using stored procedure
    is not shown to me when i referesh the report for viewing the results.
    I have used the same procedure which i mention below but can not seen the last screen which is shown in this .
    ============================================================================================
    1. Select View > Field Explorer2. Right-click on Parameter Fields and select New from the right-click menu.3. Enter u201CCustomer Nameu201D as the name for your parameter4. Under u201CList of Valuesu201D select u201CDynamicu201D5. Under the Value column, click where is says u201Cclick here to add itemu201D and select Customer Name from the drop-down list. The dialog shown now look like the one shown below in Figure 1. Click OK to return to your report design.
    Dynamic Parameter Setup6. Next, select Report > Select Expert, select the Customer Name field and click OK.7. Using the drop-down list beside select u201CIs Equal Tou201D and using the drop-down list, select your parameter field (it should be the first field). 8. Click OK to return to your report design and see the parameter dialog.The parameter dialog will appear and show you a dynamic list of values that is updated each time your run your report. It couldnu2019t be easier! In our next tutorial, we will be looking at how to use this feature to create cascading parameter fields, where the values are filtered by the preceding selection.
    Dynamic Parameters in Action
    My question is that whether dynamic parameter is working with storedprocedure or not.
    When i added one table and try to fetch records using dyanmic prameters. after that i am not be able to find the dynamic parameter option when i referesh my report.
    One more thing when i try the static parameter for my report, the option i see when i referesh the screen.
    Please reply soon , it's urgent
    Regards
    shashi kant

    Hi Kishore,
    I have tested the issue step by step by following you description, while the first issue works well in my local environment. Based on my research, this can be caused by the lookup expression or it indeed return Male value based on the logic. If you use the
    expression below, it will indeed only return the Male record. So please try to double-check the record in the two datasets and the expression in your environment:
    =lookup(first(Fields!ProgramID.Value,"DataSet1"),Fields!ProgramID.Value,Fields!Gender.Value,"DataSet2")
    As to the second issue, please try to use the following expression:
    =Count(Lookup(fields!ProgramID.value,fields!ProgramID.value,fields!Gender.value,"DataSet2"))
    Besides, if this issue still exist, in order to trouble shoot this issue more efficiently, could you please post both the .rdl  file with all the size properties to us by the following E-mail address?  It is benefit for us to do further analysis.
    E-mail: [email protected]
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to build a report in webi XIr2 using stored procedure

    Post Author: vijay123
    CA Forum: WebIntelligence Reporting
    hi,
    Is anybody can help me out how to creat a report using stored procedure in webiXir2
    thanks
    vijay

    Post Author: amr_foci
    CA Forum: WebIntelligence Reporting
    this has been posted twice.. i think

  • Using Oracle Stored Procedure in Interactive Reporting

    Hello,
    i'm trying to use Oracle Store procedure in Interactive reporting but all i get are errors.
    My env:
    Interactive Reporting 9.3.1
    Oracle Database 10.2
    I created OCE as ODBC/OBDC. Tables are returned and Stored Procedure entry is enabled.
    If i use "microsoft ODBC for Oracle" i can see stored procedure list but i get this error:
    SQL API: [SQLExecDirectW], SQL RETURN: [-1], SQL STATE: [42000], SQL NATIVE ERROR: [6550], SQL MESSAGE: [[Microsoft][ODBC driver for Oracle][Oracle]ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TEST_PDC_RECORDSET'
    If i use Oracle's odbc i get: "Error in function sequence".
    If i use Merants (5.2) odbc i cannot retreive stored procedure list. (list is empty)
    Note.
    My stored procedure works (tested via sqlplus).
    thank u daniele

    Returning (or sending in) multiple rows directly from (or to) a stored procedure is not currently possible. I have been in contact with SAP on this subject earlier, and they suggest using a web service to do the job. I used this as a work around, calling the stored procedure from a web service. I send in VC tables to this web service, and this in turn contacts my stored procedure.
    The problem is related to the connector framework in the J2EE environment.
    I am on 7.0 sps 17
    If you use stored procedure single value parameters of type varchar, number ... then VC has no problem communicating with your procedures.
    Good luck
    Henning Strand

  • How to use dynamic parameter when a report is created using Stored Procedures

    Hi all,
    any one have the idea of how to use dynamic parameter in crystal report XI R2
    when report is created using Stored Procedure.
    Regards
    shashi kant chauhan

    Hi
    You can create an SQL command in Database Expert > Expand your datasource > Add command
    Then enter the SQL query that will create the list of values to supply to the user
    eg select field1,field2 from table
    Then edit the parameter of the report.  These will be the SP parameters adn can be seen in field explorer.
    Change the parameter type to Dynamic
    Under the word Value click on Click here to add item
    Scroll down to your Command and select one of the values that you want to appear in the list
    e.g field1
    Then click on the Parameters field - this is essential to create the param
    You can edit other options as required
    That should do it for you.
    I must say that i use CR 2008 connected to Oracle 10g SP, but i reckon this will work for SQL DB and CR XI as well
    Best of luck

  • SSRS adhoc (2005/2008) - Need to create Report Model (.smdl file) for adhoc using Stored procedure

    Hi All,
    I need to create Report Models using stored procedures. But whenever I am going to create data sources for same, I am just getting tables and views to use. Please see the screenshot below:
    Is there any way out to create data source based on stored procedure? Please help.
    Thanks in Advance
    Regards
    Kumud

    Hi Kumud,
    As per my understanding, it is not support to create a Datasource View (DSV) using stored procedures.
    In a DataSource View, only views, tables or named queries can be used. We can use stored procedures in a query. No parameterized queries, parameterized stored procedures or parameterized UDFs can be used in a DSV named query. You can try to using below approach
    to achieve what you are require:
    To build views in our relational source and add the views to the datasource view to proceed with modelling.
    There is a similar issue, you can refer to it.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/22207c21-03c7-4e5a-bb67-0372f29220a3/sql-server-reporting-services-2008-creating-report-models-using-stored-procedures
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Sub report using Stored Procedure returns incorrect data

    Post Author: rikleo2001
    CA Forum: Data Connectivity and SQL
    Guys,
    I am using CR 9 in ASP.net application.
    One simple report and one Sub report, sub report is basically linked with Stored procedure accepting one parameter and returns a select query.
    Main report is linked with that sub report using that parameter field.
    Sub report is on demand sub report.
    Now when I execute that main report and click on on demand sub report I am getting Wrong order information.
    Here is out put on main report
    Order 1                                          on demandDetail
    Order 2                                          on demandDetail
    Order 3                                          on demandDetail  
         NOW If I click on Order 3 (On demanddetail link, it displays rondom order details, some time correct on too), I am really stuck and don't know where I am going wrong.
    Please help me to solve this issues.
    Many Thanks

    Post Author: rikleo2001
    CA Forum: Data Connectivity and SQL
    Hi Yangster,
    Thank you so much for your reply.
    On DEMAND Sub report is located in main report, IN DETAIL SECTION
    I am passing Order ID from main report linked to  {?morderid} in subreport under command object, and if I run it in design mode, it works perfectly alright, so problem is isolated to ASP.NET and Crystal report post back method on Crystal report.
    The example I give to you this is a simple example to identify issues in my real application and report.
    My main report contains summary of data base on unique identifier. that summary have 4 differant types of details which has to be on the same report (as Crystal report doesn't provide Nested subreport), so I decided to use 4 subreports on main report and all subreport using Stored procedure command object.(Sub report has it own complex processing requirement to fulfill).
    Please help me with any further ideas? for the sample which I presented to you this is only using one SP on main report with a simple processing.
    Many Thanks

  • Stored Procedure Universe Issues

    Working in version 3.1 SP1 Fix pack 1.8 and created some simple stored procedures to use in the universe and everything worked fine but then due to changing requirements added additional logic to the stored procedures (SQL 2005 database) for the report to include additional prompts and mulitple selects within the code.  With these changes, have encountered multiple errors when trying to insert them in the universe or when we are able to insert them in to the universe then no data ever returns from the new stored procedures even though correct execute statements are being created on the SQL Server and they work on SQL Server and in other BI tools.  Has anyone else encountered this or know of any limitations using stored procedures in universes?

    Holy thread-resurrection Batman!
    Please open a new dicussion after reading the bi4.0 data access guide: http://help.sap.com/businessobject/product_guides/boexir4/en/xi4sp5_data_acs_en.pdf
    Also, please specify which SP and Patch you are using.
    Regards,
    H

  • Error while refreshing bqy file on workspace using stored procedure

    Hi,
    I am using stored procedure which returns ref-cursor. The report is running fine locally but on Workspace, while refresh, it gives the following error.
    An Interactive Reporting Service error has occurred.-SQL API: [SQLNumResultCols], SQL RETURN: [-1], SQL STATE: [HY010], SQL NATIVE ERROR: [0], SQL MESSAGE: [[Microsoft][ODBC Driver Manager] Function sequence error]
    (0)
    I have ODBC/ODBC connection set up at BI+ configurator.
    Thanks,
    Manish

    We also met this issue. Some guy told me this is a Hyperion limitation, is it true? I really need this function in Hyperion:(

  • Calling a stored procedure in crystal report

    I am using crystal reports 11 on the front end connected to mssql server in the back end and i have a stored procedure written in mssql and has a view created. i want to know how do i call a stored procedure from crystal report when i run my report and how to pass the values from my prompt to the stored procedure

    As long as the stored procedure returns a result set, the procedure should look and act just like table and the report will know what parameters are need to execute the procedure.  If this does not answer your question, please provide more specifics.

  • Stored Procedure for Crystal Reports

    Hi All,
    I developed this test stored procedure to see wheather we could a stored procedure for crystal reports. It compiled without any problem, but when I run it, it gives me error message. Here is the stored Procedure..
    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(
    TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
    TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    AS
    BEGIN
    OPEN TEST_CURSOR FOR
    SELECT *
    FROM TEST_TABLE
    WHERE TEST_TABLE.ID = TEST_PARAMETER;
    END TEST_PROCEDURE;
    And
    This is the error message..
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'TEST_PROC' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    I have created the package sucessfully.
    I was wondering If any one of you can advice me where I am making the mistake.
    Thank you

    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
                                                         TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    ...you have 2 parameters in your procedure WOLD1SIM.TEST_PROCEDURE(). you should also use two parameters when you execute the procedure.

Maybe you are looking for

  • Dv6-1308ew TV TUNER problem codecs mpeg4 dvb t

    Player form HP do not search for any of tv programms. My signal is ok, but my country support only mpeg4 - support said this codecs will be downloaded automaticlly after configuation HP MediaSmart - but with no sucess. I installed all software, drive

  • Library rebuilds but iPhoto won't close on its own

    I recently had to restore my entire system from a backup and when I did, the largest of my libraries, 1945 photos, would not load up without doing a rebuild. The rebuild completes fine and all the photos are restored but when I try to close iPhoto, i

  • Crystal Reports and Service Desk

    I notice there is some integration between Crystal Report and Service Desk, but I need some assistance on how to get started to create Crystal Reports that will view the Service Desk data. Is there any documentationon this functionality? Thanks Simon

  • Which WM should I choose? (maybe Awesome?)

    Hi all, is a bit of time that I realized that Windows is not for me, but just last week I started to try to replace him. I installed Arch Linux on VirtualBox,and I tried Gnome 3 (which does not please me at all, unless I put it in fallback mode...),

  • Adobe Form Hanging in WDA

    Hi All, I have a requirement in my current development to display the list of HR forms(Payroll) to the end client. I am successfully able to carry out the scenario for a single Record Type but when I use the multiple scenario the Adobe Form keeps han