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
- Create a custom field in Configure Object Definition -> Document Mapping Rule Type
- Configure that field in your business rule to display the current year
- Map the rule to a Document Template Placeholder
- Generate the Document
Cause
This is happening because the custom field is configured with the 'Number' Data Type.
Example:
The following rule is configured
The CurrentYear field is being mapped to contain the current date, but when the a document is generated, the year appears like so:
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
Then the rule will need to be modified slightly to account for this change
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
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