SAP Knowledge Base Article - Public

2597306 - How to Add Leading Zeros to a String Field to bring the employees User ID username up to a required length

Symptom

  • Customers may have a requirement to "pad" or Add Leading Zeros to their employees userIDs to meet the needs of a report or an external system.
  • The customer may require all usernames to be the same length to meet the requirments of a report or external system.

Environment

  • Successfactors HCM
  • Integration Center

Resolution

This can be done through adding a calculated field in Integration center.

Lets take the scenario that the requirement is for all employees to have a 9 character Username and all UserIds in the Successfactors system are less than the required 9 character.

The Requirement is to pad the start of the Username with leading Zeros

The logic is as follows:

    1. Field Value = [User ID (userId) from User]
    2. Prepend Text '000000000'
    3. Truncate from Right 9

PrependTruncate.PNG

What this does is adds the leading zeros to the start of the UserID then truncated the userID to 9 characters.

The length and figures can be adjusted based on the individual requirements of the customer.

Keywords

KBA , LOD-SF-INT-INC , Integration Center , LOD-SF-INT , SF Integrations - EC Payroll, Boomi/ HCI, API , How To

Product

SAP SuccessFactors HCM Core 1711