SAP Knowledge Base Article - Public

3846433 - S4/HANA returns null strings and zero numbers via ODBC in Crystal report while HANA Studio shows data

Symptom

  • Crystal Report cannot retrieve correct data from S4/HANA system.
  • Retrieved data shows strings as null and numbers as 0.
  • HANA Studio displays correct data for the same object.
  • No error message is shown.

Environment

  • Data source: HANA via ODBC
  • Crystal Report 2020

Reproducing the Issue

  1. Open Crystal Reports designer and connect to HANA via ODBC.
  2. Add the HANA object S/4 Hana to the report and refresh the data.
  3. Observe that returned data has string fields as null and numeric fields as 0.
  4. Verify in HANA Studio that the same query shows correct data.

Cause

The CDS session variable for client context (CDS_CLIENT) is not set when querying the client-dependent via ODBC, causing null/zero results.

Resolution

  1. Confirm that the same HANA user is used in both Crystal Reports and HANA Studio.
  2. Enable SQL trace in HANA Studio and refresh the Crystal report to verify the SQL sent and session variables used.
  3. Open ODBC Data Source Administrator (64-bit) and edit the DSN used by Crystal Reports.
  4. In Advanced or Connection Properties of the DSN, add the property: SESSIONVARIABLE:CDS_CLIENT=

        Example: SESSIONVARIABLE:CDS_CLIENT=100 or 800, according to the target client.

    5. Save the DSN changes, reconnect from Crystal Reports, and refresh the report data.

See Also

Keywords

MBVMBEW, MBEW, Crystal Reports, ODBC, HANA, S4/HANA, null values, zero values, CDS client, CDS_CLIENT, session variable, HANA Studio, incorrect data, DSN, Add Command , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports all versions