Symptom
ERP or S4HANA to EC Cost Center Replication in SAP Cloud Integration (former CPI) failing
Error Message:
"Caused by:[com.sap.gateway.core.ip.component.odata.exception.OsciException - Caused by:org.apache.olingo.odata2.api.edm.EdmSimpleTypeException: The metadata constraints '[Nullable=false, MaxLength=X]' do not allow to format the value 'XXXXXXX' in EntitySet FOCostCenter. The metadata constraints '[Nullable=false, MaxLength=X]' do not allow to format the value 'XXXXX' for property 'externalCode'.]”
NOTE: "Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."
Environment
SuccessFactors HCM Suite, SAP Cloud Integration (former CPI)
Reproducing the Issue
Run the integration flow 'Replicate Cost Centers from SAP ERP or SAP S4HANA to SAP SuccessFactors Employee Central' in SAP Cloud Integration & it fails with the above error.
Cause
Two Possible causes for above error
1. The maximum length defined for an Employee Central externalCode field allows for fewer characters than the corresponding SAP ERP field.
2. The USE_EXTERNAL_COST_CENTER parameter is set to False in SAP Cloud Integration.
Resolution
1. Check & validate if the length of externalCode field in SuccessFactors EC is same as the length of the corresponding SAP ERP field.
2. Next, if both the corresponding fields on SuccessFactors EC & ERP are of the same length. Enter true in USE_EXTERNAL_COST_CENTER in SAP Cloud Integration. This would replicate the cost center ID from the REMOTE_EXTERNAL_OBJECT_ID IDoc field in SAP ERP to the External Object ID (costcenterExternalObjectID) field of the cost center in Employee Central.
3. Once you set this parameter to true, ensure that the visibility of the External Object ID field of the Cost Center object definition in Employee Central is Editable.
4. After changes for the configuration to take effect, Refresh Odata API Metadata Cached via SAP Note 2171588- OData API Metadata Refresh and Export - SuccessFactors
See Also
SAP Note 2747830 - ERP to SuccessFactors Cost Center Object Replication using HCI/CPI Tool with Error Message: The XML is malformed at node <XXXX>
SAP Note 2436285 - Error message "unknown property cust_toCompany for FOCostCenter" - Replicating Cost Centers from SAP ERP to Employee Central
Check out this blog posting with the complete Cost Center configuration in SAP Cloud Integration.
Keywords
CPI, Cloud Integration, FOCostCenter, externalCode, metadata constraints, USE_EXTERNAL_COST_CENTER, cost center, ERP, EC, EdmSimpleTypeException , KBA , LOD-SF-INT-CPI-ERP , Standard SF to SAP ERP or S/4HANA Integration using CPI , LOD-SF-INT , Integrations , Problem