SAP Knowledge Base Article - Public

2691497 - Comma Appearing in the Current Year Number When Generating Document

Symptom

When using the Year of Date() -> Today() business rule function to access the current year, the year returns with a comma e.g (2,018)

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental

Environment

  • Employee Central - Business Rules & Event Derivation
  • Employee Central - Document Generation

Reproducing the Issue

  1. Create a custom field in Configure Object Definition -> Document Mapping Rule Type
  2. Configure that field in your business rule to display the current year
  3. Map the rule to a Document Template Placeholder
  4. Generate the Document

Cause

This is happening because the custom field is configured with the 'Number' Data Type.

Example:

The following rule is configured

YearToDate.png

The CurrentYear field is being mapped to contain the current date, but when the a document is generated, the year appears like so:

NumberWithComma.png

Resolution

The custom field CurrentYear within Configure Object Definitions -> Document Mapping Rule Type had been configured with the 'Number' Data Type. This is usually the expected behavior of the system as most numbers would be formatted in this manner, but dates are not usually associated like this.

In order to remove the comma, the Data Type needs to be changed to String for the CurrentYear field

StringDataType.png

Then the rule will need to be modified slightly to account for this change

YearToDateFormatted.png

Then, once the document template contains a placeholder and the placeholder is mapped to this rule, the date will appear without the comma in generated document

NumberWithoutComma.png

Keywords

business, rule, document, generation, comma, date, today, year, 2,109 2,020 , KBA , LOD-SF-EC-DOC , Document Generation , LOD-SF-EC-RUL , DO NOT USE - Business Rules & Event Derivation , Problem

Product

SAP SuccessFactors Employee Central 1611 ; SAP SuccessFactors Employee Central 1702 ; SAP SuccessFactors Employee Central 1705 ; SAP SuccessFactors Employee Central 1708 ; SAP SuccessFactors Employee Central 1711 ; SAP SuccessFactors Employee Central 1802 ; SAP SuccessFactors Employee Central 1805 ; SAP SuccessFactors Employee Central 1808 ; SAP SuccessFactors Employee Central 1811