SAP Knowledge Base Article - Public

2883422 - HANA Calculation View Input parameters are not automatically generated in Crystal Reports

Symptom

  • Parameters not automatically created.
  • HANA Calculation View Input parameter are not automatically generated in Crystal Reports.

Environment

  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020
       
  • HANA database 2.0

Reproducing the Issue

  1. In HANA Studio, create a HANA Calculation View with Input Parameter(s)
  2. In Microsoft ODBC Data Source Administrator, create an ODBC DSN to the HANA system.
  3. In Crystal Reports, create a new report based to the HANA Calculation View with Input Parameters.
  4. Notice, the HANA Calculation View Input Parameters, are not automatically generated for the report in Crystal Reports.

Cause

  • HANA Calculation View Input parameters are not supported in Crystal Reports.

Resolution

  • To workaround this, create a Command Object to the HANA Calculation View, and manually create the parameters for the HANA Calculation View Input Parameters in the SQL Query to the HANA Calculation View. Below are the general steps:
      
    1. In Crystal Reports, create a new report,
        
    2. In the "Database Expert" window, connect via ODBC to the HANA system.
         
    3. Under the ODBC connection to HANA, double click on "Add Command"
        
    4. In "Add Command To Report", create a SQL Query to HANA to query the HANA Calculation View. The SQL Query will be like:

      SELECT […]
      FROM <viewname> ('PLACEHOLDER' = ('$$<parameter name>$$',<parameter value>)
      WHERE <attribute name>=<filter value>

      Below is an example of how the SQL Query will look like:

      SELECT *
      FROM "_SYS_BIC"."<MyPackage>/SALES" ('PLACEHOLDER'=('$$VARCURRENCY$$','XXX'))
      WHERE Education='YYY'

    5. Create the number of parameters, equal to the number of Input Parameters there is in the HANA Calculation View, by clicking on the button "Create..." below the section "Parameter List"
        
    6. Update the SQL Query, and insert the parameter(s) surrounded by single quotes, where the Input Parameter(s) will be in the HANA Calculation View. Below is an example of an SQL Query with the parameters:
        
      SELECT *
      FROM "_SYS_BIC"."<MyPackage>/SALES" ('PLACEHOLDER'=('$$VARCURRENCY$$','{?MyCurrency}'))
      WHERE Education= '{?MyEducation}'

    7. Still in the "Add Command To Report" window, click "OK"

    8. You will then be prompted by the parameter(s), select values, and click "OK"

    9. Back to the "Database Expert" click "OK"

    10. In the report design, add the database fields to display on the report.
        
        
  • Note: For detailed steps with screenshots, see the document in the Attachments section.

See Also

Keywords

CR, HANA View, Calculation, Input parameters , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2016 ; SAP Crystal Reports 2020

Attachments

Using SAP HANA Variables with SAP BusinessObjects BI4.0_modified.pdf