SAP Knowledge Base Article - Public

2523258 - Compensation and Variable Pay - Cannot Class String to Date Error Message when Publishing Completed Forms to Employee Central.

Symptom

Customers have forms completed for a Variable Pay Template integrated with Employee Central.
Now, they want to Publish Selected Worksheets in Employee Central in the Completed Compensation Cycle but the job fails and the error message is:
This scheduled job failed to complete. For details, please contact SuccessFactors customer support.
java.lang.ClassCastException: Cannot cast class java.lang.String to class java.util.Date

"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 HXM Suite
  • SAP Successfactors Compensation
  • SAP Successfactors Variable Pay

Reproducing the Issue

1. Login into Customers Instance. Navigate to Admin Centre>Compensation>Variable Pay>Template Name>Manage Worksheets>Manage Worksheets. You can see that forms have been completed.

2. So, after this we would expect that we can Publish Completed Worksheets to Employee Central. So, navigate to Template in Question>Complete Compensation Cycle>Publish Data>Publish Selected Worksheets in Employee Central. Please choose Completed Worksheet(s) and click Submit.

3. Now, we can see the Job is in Process and the Job ID.

4. Navigate to Admin Centre>Monitor Jobs and we can see the Job Status is “Failed”.

Cause

  • According to the error logs for this issue, when publishing Varpay data to EC side, field types for the custom publish dates didn't match. The system is expecting "Date" type but found "String" type.
  • Reviewing the template XML we can find a configuration error:

< comp-hris-field-map>           
       <comp-field-id><![CDATA[EC_EFFECTIVE_DATE]]></comp-field-id>
       <hris-field-id><![CDATA[pay-date]]></hris-field-id> 
< /comp-hris-field-map>

  • EC field pay-day is always "Date" type while the defined Variable Pay field "EC_EFFECTIVE_DATE" (this is just an example) is, in this case, a "String" type field.

Resolution

  1. Navigate to Admin Centre>Compensation>Compensation Home>Template in Question>Design Worksheet>Column Designer>Field containing the custom Effective Date and change the Column Type from String to Date.
  2. This change will require to relaunch forms so it will take place.

Keywords

Variable, Pay, Employee, Central, String, Date, Java, compensation, publish, fail, EC, failed, type, field, bootstrap, class java.lang.String cannot be cast to class java.util.Date (java.lang.String and java.util.Date are in module java.base of loader 'bootstrap') , KBA , LOD-SF-VRP , Variable Pay Programs , LOD-SF-CMP , Compensation Management , Problem

Product

SAP SuccessFactors Compensation all versions ; SAP SuccessFactors HCM suite all versions