Create Calculated Fields in SAP Query for HR and Payroll Data

  • by Danielle Larocca, Senior Vice President, Human Capital Management, EPI-USE Labs
  • October 15, 2003
When you want to perform calculations on your data, you may be accustomed to downloading an R/3 report into Microsoft Excel and performing calculations there. However, you can save yourself some work by creating the calculated fields in SAP Query itself. Using an example query, the author shows you how.

At some point, you will want to perform calculations on your data. You may think you have to resort to downloading an R/3 report into Microsoft Excel and performing calculations there. However, did you know you can save yourself some work by creating the calculated fields in SAP Query itself?

SAP Query is an SAP-delivered report writing tool that can be used for reporting on any application area or module within SAP. The creation of calculated fields is available in versions 4.0 and higher. For more information on SAP Query, see my SAPexperts articles, “HR’s 5 Reporting Options in R/3, How Do You Choose?” and “SAP ERP HCM’s 5 Reporting Options: How Do You Choose?”.

In SAP Query, you can multiply an annual salary by 4 percent to determine potential increases or inflation for salary projections and budgeting. Or you can take an employee’s hire date and subtract it from the current date or a future date to determine or project their length of service. I find calculated fields most helpful when I want to compare the differences between two columns in a report, such as an employee’s cost center stored on infotype 0001 and the cost center that came through with their time sheet on infotype 315.

In addition, you can use calculated fields to:

  • Perform “if-then” statements. If an employee’s termination reason code is A1 (death) or B1 (better opportunity), you can output a column that defines the termination as unavoidable.
  • Output symbols and pictures if certain conditions are met. If an employee has been terminated but the benefits are still active, you can include a red flag next to the line on the report output for that person.
  • Calculate wage types. If an employee is paid bi-weekly and you want to calculate his annual salary, you can create a calculated field that says if the wage type record equals 1023, then multiply the wage type amount by 26.

Danielle Larocca

Danielle Larocca is currently the Senior Vice President of Human Capital Management for EPI-USE Labs. Previously she was the Executive Vice President of Operations/Chief Knowledge Officer at a technology start-up. She has more than 20 years of strategic leadership experience in multi-national business, business process re-engineering, and project and people management. Danielle is an expert on SAP Human Resources (HR) and reporting and has authored four best-selling books on SAP. She is a regular speaker at numerous conferences around the world on topics such as HR, technology, change management, and leadership. She is an official SAP Mentor, a global designation assigned to less than 160 professionals worldwide, who serve as influential community participants in the SAP ecosystem. This group is nominated by the community and selected by the SAP Mentors’ Advisory Board to keep SAP relevant. Danielle also serves as an expert advisor for SAP Professional Journal

Danielle will be presenting at the upcoming SAPinsider HR 2017 conference, March 6-9, 2017, at the Walt Disney World Swan and Dolphin Resort. For information on the event, click here

See more by this author


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.