SAP Knowledge Base Article - Public

3776984 - Tips to have a better performance in business rules where lookup() function needs to be used multiple times.

Symptom

Lookup() function might be needed from time to time in business rules, and it is noticed that the performance of lookup() function might take a bit of time especially when the data source amount is large or the lookup() function is called multiple times in multiple branches.

Please understand, the lookup() function carries out a direct data retrieval from database table based on the search criteria given and fetches the first matching entry from the top of the stack. So it may have slow performance when the data table is large and the first matching entry is not among the top of the stack record. 

This KBA provides tips on how we can have a better performance in business rules when lookup() function needs to be called multiple times.

Environment

  • SAP SuccessFactors Employee Central - Time Sheet
  • SAP SuccessFactors Time Tracking

Resolution

If a lookup() function with same searching criteria needs to be executed multiple times, for example in different IF branches etc, please create a variable to persist the fetched value by lookup() function, and then directly include this variable in branches for condition validations. 

In this way, the execution of lookup() function will be reduced to only once when updating the variable. 

Keywords

business, rule, save, validation, evaluate, lookup, look up, table, variable, slow, performance, long, time, sheet, tracking, employee, entry, external, data , KBA , LOD-SF-EC-TMS , Time Sheet , LOD-SF-TTR , Time Tracking , How To

Product

SAP SuccessFactors Employee Central all versions ; SAP SuccessFactors HCM Suite all versions ; SAP SuccessFactors Time Tracking all versions