SAP Knowledge Base Article - Public

3499303 - Calculated field using DateTime fields is not working properly in Integration Center - SuccessFactors

Symptom

You created a calculated field using DateTime fields, and the calculation is not working properly.

In this example, we will use field companyExitDate as the DateTime field as comparison with Today's date as parameter. 

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 HCM Suite
    • Integration Center

Reproducing the Issue

If you are facing this issue, you probably created the calculation in the wrong way, similar to the below steps: 

  1. Add the calculation and in the If/Then/Else calculation, you add the DateTime Field, which in this example we will use 'companyExitDate'.
  2. Then, you select for example "is greater than or equal to", in the comparison parameters. 
  3. And then you will write <Today> in the last field, to compare the DateTime field with Today's date. 
  4. In the "Then"and "Else" field you can put anything you want as result, such as 'companyExitDate' to "then" and keep blank in the Else. 

In theory, this would compare Today's date (July 23rd 2024) with the field date, and in case it's greater or equal then Today, it would display the field value. If it's less than Today, it would be blank. The calculation would be something like this: 

Cause

The Integration Center tool is not taking '<Today>' as a DateTime parameter. It's basically comparing a DateTime field with a String, hence that's why the calculation won't work.

Resolution

You need to re-build the logic of your Calculation. 

One option, would be to re-create the calculation using Today as the value for Field Value. Then, you compare the Field Value to the DateTime field that you want, and configure the Then/Else as you please. For example: 

  1. Select Field Value as Today. 
  2. Add one row below, and select the If/Then/Else condition, and in the first dropdown select Field Value (which is equal to Today). 
  3. Then select the "is less than" parameter in the condition
  4. And finally then, you select the DateTime field (companyExitDate in this example) as the last field of the second row. 
  5. In the Then and Else parameters, we will keep the same as in the example of the "Reproducing the Issue" section. 

See how the configuration is now: 

Even though we have not changed the Then/Else configuration, the Calculation Trace now shows us that the calculation is working properly, with the conditions being compared as expected. 

Now, Today's date is actually being compared to the companyExitDate value properly, as explained in the 'Symptom' section of this KBA. 

See Also

Here you can check other KBA's regarding issues with Calculated Fields in Integration Center:

3042857 - Integration Center shows correct result in Preview but delivers wrong value in Output file (Run now) - SAP for Me

3435613 - Calculated Field in Integraction Center Job not working correctly - SAP SuccessFactors integration center - SAP for Me

Keywords

calculation, DateTime, String, If/Then/Else, Date, calculated field, not calculating.  , KBA , LOD-SF-INT-INC-FWK , Integration Center UI Framework , Problem

Product

SAP SuccessFactors HCM Core 2405