SAP Knowledge Base Article - Public

3624190 - ADD_MONTHS or ADD_YEARS functions does not work and an error occurs when deploying a Fact View with Input Parameter without default value in SAP Datasphere

Symptom

"Invalid DATE, TIME or TIMESTAMP value: invalid calculated date value at 'add_years' function (at pos 1386), Code: 303, SQL State: 22007." error occurs when deploying a Fact view that contains an Input Parameter without a default value for a Date type dimension.

Environment

SAP Datasphere

Reproducing the Issue

  1. Logon to Datasphere tenant.
  2. Open the the Fact view which contains Input Parameter with default value set.
  3. Edit the Input Parameter, remove default value click OK.
  4. Deploy the view. The view will be deployed ,and be previewed at the same time.
    =>Then below error shows:
    Invalid DATE, TIME or TIMESTAMP value: invalid calculated date value at "add_years" function (at pos 1541) , Code: 303, SQL State: 22007
  5. Preview the view.
  6. Input a value for the prompted Input Parameter.
    => No error shows. The issue is that when deploy the view, it will be auto previewed, Input Parameter does not pops up for user to input the value, so error shows. If the Input Parameter has default value, it will not be previewed at the same time when deploy the view.

Cause

  • This is a design limitation of the current product.
  • The issue occurs during view validation, not data preview. Validation of the ADD_MONTHS  or ADD_YEARS function requires a value. Prompting the user for a value during validation would disrupt several tasks/steps in SAP Datasphere. We do not plan to change this behavior. Users need to define default values for input parameters.

Resolution

  • Define default values for Input Parameters.
  • To request a new feature or product enhancements, SAP has defined a new process and tool called Influence and Adopt. Influence and Adopt, allows customers to log Enhancement Requests themselves and have the ability to work more directly with our technology and development group.

    The ideas with the most votes will receive a higher level of attention for response and consideration. The processes and procedures associated with this site will continue to evolve and enhance over time. Refer to Knowledge Base Article 3332382 for more details.

See Also

Refer to: ADD_MONTHS Function | SAP Help Portal

Keywords

add_month, invalid date value, SQL State 22007, deploy view, input parameter, default value, preview error, hana cloud, validation issue, fact view. , KBA , DS-MD-VIW , Views , Problem

Product

SAP Datasphere 1.0