SAP Knowledge Base Article - Public

3194600 - How to sum all values from a one-to-many navigated entity field into a single field - Integration Center

Symptom

How to sum all values from a navigated entity which has a one-to-many relationship with the starting entity in Integration Center?

For example: you start your integration in EmpJob and you navigate to employmentNav > compInfoNav > empPayCompRecurringNav to select the field "amount", however there are several "amount" values in EmpPayCompRecurring entity:

You want to sum them and return the result in a single field.

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

Resolution

You can use a calculated field to perform this sum operation. The logic would be the following:

  1. Add a calculated field
  2. Change the Data Type to "Numeric", since we will be summing numbers:



  3. In the first line select the "For Each Entity" operation:



  4. Click on "<Specify an Entity>" button and select the one-to-many navigation containing the field that will have its values summed up. In our example would be employmentNav > compInfoNav > empPayCompRecurringNav:


    Note: you will select the navigation (the field that is named with "nav" in the end, for example "empPayCompRecurringNav"). The field that you will sum the values (in our example "amount" field) will be selected afterwards.

  5. Edit the second line of the calculation and follow these steps:

    The first field you'll leave it as "Field Value =":


    The second field is the field that you want to sum its values, so click in the three lines button, click on "Associate Field" option and select the field you want:




    In the third field select the "+" character:


    In the fourth field you'll have a note saying Operand:


    Click on it and manually type the value <FIELDVALUE>:


    The fifth field you can leave it blank.


  6. Click OK and Save.

This calculation logic will sum all the many values returned from the field selected from the one-to-many relationship. In the example shared before, the values below would be the "many values" from empPayCompRecurring:

And this is the result of the calculated field:

Keywords

add, adding, summing, logic, calculation, total, double, number, , KBA , LOD-SF-INT-INC-FWK , Integration Center UI Framework , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HCM suite all versions

Attachments

Pasted image.png
Pasted image.png
Pasted image.png
Pasted image.png