Key Concept

Calculated (or local) fields in SAP query allow you to greatly extend the functionality of SAP query. Within a query you can create your own fields based on other fields extracted from the database according to your own requirements. Calculated fields are derived using formulas based on string functions, numerical calculations (e.g., addition, multiplication, or percentages), or logical rules (e.g., if, or, and, or else). Custom fields most commonly are text or numerical fields, but they can also be displayed as graphical symbols or icons.

The payroll team often asks to have queries set up to identify new employees who don’t have tax codes, national insurance categories, or bank details set up before their first payroll run. I explain how you can easily add traffic light icons that instantly identify and highlight problem records, making these queries much more user-friendly and effective.

Consider a scenario in which the payroll team wants to run a query to check that every new employee has been set up with a valid payment method record on infotype 0009 (bank details). The company policy is to pay all employees by direct bank transfer (known in the UK as BACS transfer and in the US as direct deposit). The only exception is for new employees who are having bank accounts set up, in which case it is acceptable to pay by check only until a bank account is set up. No other payment methods (e.g., cash or international bank transfers) are allowed. By running this query, the payroll team can prevent missed payments to those employees for whom no payment method has been input and proactively follow up on employees who have been set up with temporary check payments.

To meet this requirement a simple SAP query based on payment method is set up with a traffic light icon in the final column (Figure 1). The descriptions of the traffic light icons are as follows:

Green: The employee is set up correctly with a valid electronic bank transfer payment method record.

Yellow: The employee is set up with a temporary check payment method that needs to be followed up and replaced by a permanent direct bank transfer record.

Red: The employee is missing a valid bank record.

Figure 1

Employee payment method query with traffic light icon

Would you like to see this full item?

Owen McGivney

Owen McGivney is a senior consultant at iProCon Ltd., part of the iProCon group, based in London, England. He has worked on implementing SAP HR and payroll systems since 1998. Owen has delivered UK, Irish, and multi-national payroll solutions for a wide range of private- and public-sector clients. He has a special interest in combining ABAP programming with configuration to create innovative and effective solutions.