SF replication to HCM: Value conversion in Business Integration Builder

The integration between SuccessFactors Employee Central and the ERP system can sometimes be difficult due to the differences in the data models of the integrating systems. With the Business Integration Builder, it is possible to create value conversion rules that help us do the necessary transformations to convert the EC data into the ERP data format and vice versa. In this blog article, we will explain the different operations that can be performed with the conversion rules and provide some practical examples. This article specifically focuses on systems that use the PA_SE_IN component. Systems with the ECS4HCM component have additional functionalities that will not be covered here.

Configuration and structure of value conversion rules

The value conversion can be used for organizational and employee data and they are defined within the transformation template groups in the Business Integration Builder framework:

Organizational data:

Employee data:

Before diving deeper into the configuration of the different types of conversion rules, it is important to know the fields that make up a conversion and how it works:

FieldDescription
Sequence numberIf the conversion requires several actions, this field refers to the order of execution.
Conversion ruleIt defines the operations to be performed. There are three different groups of conversions: Arithmetic, String and Special conversions.
Parameter 1The function of this parameter depends on the conversion selected
Parameter 2The function of this parameter depends on the conversion selected
EC FieldEmployee Central field ID to be used
Inbound/Outbound IndicatorThe direction in which the rule is applied. There are two options: ERP to EC or EC to ERP.

A conversion rule is applied to a specific Employee Central field from the Employee Central entity to format/change its value before the primary field mapping and the value mapping are processed in the ERP system.

Take into consideration that a generic value conversion is processed before the secondary mapping. Therefore, if you define conversion rules for a field that is used as a linking field for secondary mappings, those secondary mappings don’t use the value that was originally stored in this field. Instead, they are based on the value that is changed by the conversion rules.

In addition to generic value conversion, it is also possible to use country-specific value conversion, where you can select the country for which the conversion needs to be performed.

It is important to note that in some value conversion rules, regular expressions such as <nbsp>, /s, ^, and others can be utilized. These expressions enhance the flexibility and effectiveness of conversion rules, enabling us to address more complex requirements.

Types of conversion rules

There are three different groups of conversions. Let’s analyze the types of conversion rules in each group. From now on, the original value of the EC field will be referred to as the Input value, and the value after applying the conversion rule will be the Output value.

Arithmetic conversion rule

01 – Multiplication with a number:

The input value is multiplied by the value in the Parameter 1 field.

String conversion rules

11 – Replace using patterns with string/EC field:

The characters in the input value that match the pattern in the Parameter 1 are replaced by one of the following options:

  • The value from the field defined in EC Field.
  • The string in the Parameter 2, if EC field is empty.

Example:

The IBAN field contains spaces which cause a replication error. The spaces can be easily removed by using this rule in combination with the regular expression \S.  In Parameter 1 we use „\s“ to detect spaces and leave Parameter 2 empty to delete those spaces.

Input value: 1111 2222 3333 4444 5555

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0111 Replace using patterns…\S  EC to ERP  

Output value: 11112222333344445555

12 – Append with string/EC field:

This rule adds a suffix to the input value. There are two ways of working.

  • Using the EC field: the value from the field defined in EC Field is attached at the end of the input value and separated by the string/character in Parameter 1.
  • Without using the EC field: the string in Parameter 2 is attached at the end of the input value and separated by the string/character in Parameter 1.

Example:

Imagine that we need to replicate the Street and house number which are stored in separated fields in EC into one single ERP field. We will map the EC field Address 1 which contains the street in EC and we will use a conversion rule to append the house number:

Input value: Fifth Avenue

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0112 Append with str…<nbsp> 19EC to ERP  

*In our example, the EC field 19 corresponds to the house number in EC.

Output value:  Fifth Avenue 213

The expression <nbsp> in the Parameter 1 is used to separate the street and house number with a space.

13 – Adjust string to length:

Using this rule is possible to adjust the input value to a specific length defined in parameter 1. But there are two possible options:

  • If the length of the input value is longer than Parameter 1, the input value is cut off at the end.
  • If the length of the input value is shorter than the value in Parameter 1, the input value is filled up with the characters in Parameter 2 until it reaches the length defined in Parameter 1.

Example 1:

An EC field contains an ID with 9 numbers + 1 letter, but we only need to replicate the numbers.

Input value: 123456789A

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0113 Adjust string to…9  EC to ERP  

Output value: 123456789

Example 2:

An illustrative example of this rule in application is the mapping of the Spanish National ID from EC to the PERID field in the infotype 2. In this case, the document type needs to be added in the 19th character of the string so that the infotype can process it properly. That’s why it is necessary to add spaces to the original national ID until it reaches 19 and then append the document type.

Input value: 12345678A

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0113 Adjust string to…19<nbsp> EC to ERP  
0212 Append with str…  17 

*In our example, the field 17 corresponds to the Card Type in EC and it has value 1.

Output value: 12345678A          1

For additional information about this mapping, you can check the SAP note 2827806

14 – Prepend with string/EC field:

This rule is similar to the number 12 but adding a prefix instead of a suffix.

  • Using the EC field: the value from the field defined in EC Field is attached at the start of the input value and separated by the string/character in Parameter 1.
  • Without using the EC field: the string in Parameter 2 is attached at the start of the input value and separated by the string/character in Parameter 1.

15 – Replace with string/EC field:

  • Using the EC field: the input value is replaced by the value from the field defined in EC Field.
  • Without using the EC field: the input value is replaced by the string in Parameter 2.

This conversion rule is very useful to map the same EC field to several infotype fields. A „dummy“ Employee Central field is mapped to the second infotype field and its value is replaced with the value from the Employee Central field that you actually need to map.

Example:

For some countries, it is necessary to replicate the EC field ‘Date Of Birth’ to two different fields in the infotype 2: Date of Birth (GBDAT) and Date of Birth According to Passport (GBPAS). One of these fields can be mapped just with a simple primary mapping without using a value conversion (for example, the field GBDAT). However, the field GBPAS will be mapped through a generic value conversion:

Input value: XYZUSER (the EC field ‘Created by’ has been used as a dummy field).

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0115 Replace with string/EC…  21*EC to ERP  

*in our example, the field 21 corresponds to the date of birth in EC.

Output value: 19751102 (the value XYZUSER has been replaced by the date of birth).

16 – Split before string/character:

It splits the input value at the first occurrence of the string or character provided in Parameter 1, and discards everything after it.

Example:

The EC field Location has the following format xxxx-xxxx, but we only want to map the digits before the character ‘-‘ to the field Personnel Area in our ERP system:

Input value: 1000-0001

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0116 Split before string/character 22*EC to ERP  

*in our example, the field 22 corresponds to the location in EC.

Output value: 1000

17 – Split after string/character:

It is similar to the conversion rule 16. It divides the input value at the first instance of the string or character specified in Parameter 1 and removes everything preceding it.

18 – Edit using pattern:

It inserts characters or strings at specific positions of the input value using a mask.

Example:

In your EC system there is custom field that contains a registration ID of 10 characters, but it is necessary to replicate it in your ERP system separated by a hyphen each 3 digit and a slash before the last character.

Input value: 589375286A

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0118 Edit using pat…___-___-___/_  EC to ERP  

Output value: 589-375-286/A

Special conversion rules

These rules are not applicable for migration to EC (PA and OM) or for replication to HCM with OM.

31 – Check and replace:

This conversion rule verifies whether the value from the field defined in the EC Field matches the string in Parameter 1. If so, then the input value is replaced by the string in Parameter 2.
Only fields from the same Employee Central entity as the input field can be compared.

Example:

A custom field in EC needs to be replicated into the ERP system with the value 10 only when the work schedule is WS1000.

Input value: 50

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0131 Check and replaceWS10001037EC to ERP  

*in our example, the field 37 corresponds to the work schedule in EC and it contains the value WS1000

Output value: 10

32 – Check and remove:

There are two possible ways of using this rule:

  • With the EC field: the value from the field defined in EC Field is compared with the string in Parameter 1. If they match, the processed payload data is deleted..
  • Without the EC field: the input value is compared with the string in Parameter 1. If they match, the processed payload data is deleted.

Example:

This conversion rule is very useful when multiple EC data records with the same time validity are replicated to an infotype which does not have a subtype field or does not allow multiple records for the same period.

A practical example is the solution used to replicate Benefits related to recurring and One-Time information payments to the infotype 14 and 15 when using SAP SuccessFactors Employee Central Benefits.

EC may send two records for each recurring info with active and inactive status. To replicate only active records, a generic value conversion for each field must be created to filter the inactive records:

Input value: ****

Seq. No.Conv. ruleParameter 1Parameter 2EC fieldI/O Indicator
0132 Check and removeI 45EC to ERP  

*In our example, the field 45 corresponds to the effectiveStatus in EC.

Output value:  the payload data is removed.

For additional information about replicating Benefits Integration Recurring Information and One-Time Information, please check the SAP note 3307825.

33 – Check and remove when doesn’t match:

The logic is pretty similar to the previous rule, but if the compared values don’t match, then the data of the processed payload is deleted. Here, it is also possible to use it in two different ways:

  • IF  Value EC Field ≠ Parameter 1  THEN  Delete
  • IF  input value ≠ Parameter 1  THEN  Delete

In conclusion, value conversion rules are an extremely powerful tool and should always be preferred over custom ABAP coding for migration and replication logic wherever possible. In many cases, challenges can be addressed through the creative use of these rules. If you think it is not possible, take another look, there’s usually a way.

Keine Kommentare

    Deja una respuesta

    Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

    es_ES