SAP Knowledge Base Article - Public

2891074 - EC: Business rule to change the date format in document generation template

Symptom

  • How to change the display format of Date in document generation template
  • Change the current date format from MM/DD/YYYY or DD/MM/YYYY to DD MON,YYYY
  • Example, change date format from 11/02/2020 to 11 Feb,2020 in document generation template

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

Environment

SAP SuccessFactors Employee Central: Document Generation

Reproducing the Issue

  1. Create a new document template to display current date (refer KBA: 2877407)
  2. Generate document for an employee
  3. Notice the date format in the document template is as per the language preference selected (refer KBA: 2730729

Resolution

  1. Create a new Basic rule
  2. Base object DocumentMappingRuleResult
  3. Add another parameter as per the information/section you are consuming
  4. Use Get Month Name(), Day of Month() and Year of Date() function as below and create 12 if else structure for all 12 months:

Note: 3450036 - Document Generation alignment issue for different languages (Arabic/English) - Employee Central 

It is not recommended to have two different languages in the same template as it can create alignment issues. Arabic languages are from right to left, whereas English languages is from left to right.
We recommend to have two different template created with language field set as "English" and another document for "Arabic".
Or you can use table and add required text in English in one side and Arabic in another and generate the document.

FAQ - Additional Information

Q) Where can I get information on this from the Guide?

A) Guide: Implementing Document Generation  // Chapter: Field Details for Document Template Screens

    Calendar:

  • Choose the calendar type based on which dates should be displayed in the document.
    The default calendar type is Gregorian.

A) Guide- Managing Languages, Text Customization, and Localization Chapter : Disabling the Dual Calendar / Chapter: Dual Calendar

See Also

  • 2730729 - Date Format For Document Generation
  • 2877407 - EC: Rule to display Current Date in generated Document Template
  • 2269945 - List of Supported Languages with Locales (BizX)
  • 3115662 - System does not respect user's selected language
  • 2089472 - Text Replacement: How to change words using replacement
  • 2347226 - Employee Central Implementation - Document Generation FAQ
  • 3450036 - Document Generation alignment issue for different languages (Arabic/English) - Employee Central
  • 2444828 - How to map primary email address in document generation template

Keywords

date format, document generation, change date format, change date document generation, current date format, document template current date, change current date, default local, calendar , KBA , LOD-SF-EC-DOC , Document Generation , How To

Product

SAP SuccessFactors Employee Central all versions ; SAP SuccessFactors HCM Core all versions

Attachments

CurrentDate.PNG
DocumentTemplateResult.PNG