SAP Knowledge Base Article - Public

2514298 - Data Type Year Allows all Characters to be Entered (Letters and Numbers)


You are using the DataType Year in your custom code logic in the Cloud Application Studio. When the end-user attempts to use this field, they are allowed to enter all values including characters (e.g. '201Y'), and the system does not give a warning or an error message.

Reproducing the Issue

The issue could occur in any view or document where you have added this field. We will use the Sales Order document as an example:

  1. Go to the Sales Orders work center.
  2. Go to the Sales Orders view.
  3. Open any sales order.
  4. Locate the extension field XYZ that you have created for the data type year (XYZ represents the name of the extension field).
  5. In field XYZ, enter any value e.g. 201Y.
  6. Select the Save button.
  7. The system will accept this value, even though it is not a date format.

You expect that only a date value such as yyyy (yyyy represents the year)


The Root Cause of this issue, is caused by the Implementation Type of this DataType. It is of type CHAR, which comes from the DataType String.

This means all characters can be used as values. Please see the below image, taken from the Repository Explorer within the SDK:




To resolve this issue, you will need to create your own custom code logic, to implement a Validation for this field, to ensure that only the desired values are entered.

A workaround for this issue, can also be to create and implement a Drop-Down List instead of allowing end-users to enter their own values.

See Also

For further information, please also refer to the below tools:

  • The Repository Explorer inside the Cloud Application Studio SDK.
  • The SAP Cloud Application Studio Help documentation inside the SDK.
  • The SAP SCN, in the Cloud Application Studio forum.



KBA , LOD-CRM-EMP , Employee , How To


SAP Business ByDesign all versions ; SAP Cloud for Customer add-ins all versions