SAP Knowledge Base Article - Public

1852009 - Error: ‘/CRYSTAL/OSQL_EXECUTE_QUERY…’ when refreshing reports based off SAP Tables in Crystal Reports

Symptom

  • Some reports generate the error: 

    "Database Connector Error: ‘/CRYSTAL/OSQL_EXECUTE_QUERY returned: subrc: 4.
     Message: Incorrect nesting: Before the statement “ENDFORM”, the structure introduced by “IF” must be concluded with “ENDIF”… Line: 174/ Word:0’"
     
  • When refreshing reports based off SAP Tables in Crystal Reports, it generates an error.
  • After applying a product update to Crystal Reports, some reports that uses linked SAP Tables fails with an error.

Environment

  • SAP Crystal Reports 2008 with Fix Pack 5.3 and above
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013

Reproducing the Issue

  1. In Crystal Reports, create a report off SAP Tables.
  2. Link the SAP Tables on the report.
  3. Add fields from each tables to the report.
  4. When refreshing the report, it fails with the error message:

    Database Connector Error: ‘/CRYSTAL/OSQL_EXECUTE_QUERY returned: subrc: 4.
    Message: Incorrect nesting: Before the statement “ENDFORM”, the structure introduced by “IF” must be concluded with “ENDIF”… Line: 174/ Word:0’

Cause

  • The issue has been identified and logged under Problem Report ID ADAPT01676765.

Resolution

  • The issue is resolved in the following product updates:
          
    • Crystal Reports 2008 and the SAP BusinessObjects Enterprise Integration for SAP Solutions for XI 3.1:
      • Fix Pack 5.5
      • Fix Pack 6.1
      • Service Pack 7
            
    • Crystal Reports 2013
      • Support Pack 01
           
  • Important note: Once the product update is applied, load the SAP Integration Kit Transports that comes with the product update to the SAP System.

Keywords

CR, ERP, ECC , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Bug Filed

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013