SAP Knowledge Base Article - Public

2387814 - Document Generation - How to map Pay Component data to a Document Template

Symptom

This article is meant to provide you with a "How to" on mapping Pay component data to a Document Template.

Please note that the resolution for this how to is meant as an example.

"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 Employee Central: Document Generation

Resolution

There are two ways to do this - either using a Business Rule, or by using Direct Mappings. Below we cover both methods.

 

-Include Specific Pay Component Amount in Document using rule mapping:

If you want to include a specific Pay Component Amount in a Document, you need to use a Business Rule. Please configure the rule as follows -:

1) Base Object = Document Mapping Rule Result

2) Add a Parameter as follows (note that the object is referring to hris-element "payComponentRecurring" and NOT "compInfo")-:

Name Code Object
Compensation Compensation Compensation

3) You need to define an IF condition - it cannot be set to "Always True". Therefore in the below example where we have one "Base Salary" pay component per country, we had to add multiple "Else IF" conditions to ensure the Salary is populated correctly -:

Example_Rule_payComponent.jpg

The important things to note are :-

  • In the "THEN" condition, the field "Salary" on the MDF Object "Document Mapping Rule Result" is infact "genericNumber1" field. The amount will be displayed in the document as a whole number. If you want the decimal value to be displayed, you have to add a custom field with Data Type of "Decimal" from the said MDF Object. However, please note that the trailing zeroes after the decimal point cannot be displayed in the generated document. You could also add other custom field to this object if required - but make sure the field type is the same as the source
  • In the THEN condition, we have to drill down through Compensation > Employment Details > Compensation to get the extra option to "Select Compensation.Employment Details.Compensation where..." so we can tell the rule WHICH row to pull "Amount" from. Here we use the same Pay Component that is used in the IF part of the rule.
  • Because we want this rule to work no matter which of the Base Salary pay components applies, we use multiple "Else IF" statements to ensure all possibilities are considered.
  • Note:We do not support model rules object in the rule mapping for document generation.

 

 

-Include ALL Pay Component Amounts in Document using direct mapping:

If you want to include ALL of the Pay Components/Amounts that are defined for an employee, then it is simpler to not use a rule, and instead use a table and the Direct Mappings. For example -:

1) In your Document Template, you must create a Table. This is explained also in the Document Generation Implementation Handbook. Navigate to your Document Template, and click the "Table" icon -:

Add_a_table.jpg

2) Make sure the table has 2 rows and 4 columns. Then add the columns Label in the 1st row, and then a "Placeholder" in the 2nd row -:

add_columnlabel_and_placeholder.jpg

3) Save the template and go to the mapping for the template. For each of your placeholders, make a Direct Mapping to the "Compensation" fields as follows -:

PayCompMappings.jpg

The result is:

PDF_Output.jpg

Note:

  • Pay component and Pay component non recurring are grid portlets with a parent and child relationship to compensation info portlets. This allows doc gen to pull multiple pay components into a table. For elements like National Id or Job relationships, Document Generation can only pull the first row of data, and no other due to there being no parent and child relationship to an effective dated portlet like compensation information
  • Previous value of a Pay component amount or frequency can be pulled for all pay components for an employee can be fetched and generated using pastDirect and futureDirect mapping type in mapping template.
  • We can't calculate the difference between a pastdirect/future direct with the current record in a business rule due to not being able to reach data from records outside of the current effective record with HRIS elements.

See Also

Document Generation guide

Keywords

Document Generation, Recurring Pay Component, Salary Information, payComponentRecurring, Document Mapping Rule Result, Business Rule, previous amount, trailing zero, decimal, rule, direct , KBA , LOD-SF-EC-DOC , Document Generation , LOD-SF-EC , Employee Central , How To

Product

SAP SuccessFactors Employee Central all versions ; SAP SuccessFactors HCM Core all versions