When creating reports with SAP Query there may be occasions where you want to highlight or flag certain records for attention, real-world HR examples include:
- Listing all associates and their salaries and flagging those that are over the maximum (or under the minimum) for their pay grade
- Listing all associates and flagging those who are out on a leave
- Listing all associates and their performance scores, flagging those who scored less than “meets Expectations”
- Identify associates who are under (or over) a specified age (such as 18) to assist you in determining which associates are eligible for particular benefit programs or which require review
- Identifying rehires who were previously terminated with a bad termination code
To do this we simply use calculated or local fields within your SAP Query. I blogged on how to create a calculated field – check it out “Creating calculated fields in your report (How to Eliminate Duplicate Line Reporting in Query Tools)” here on SAPINSIDER.
To insert a picture, only w
hen certain conditions are met please follow the steps below. This will insert a flag for associates born earlier than 1989 as shown in picture.
- Navigate to the Select Field screen (#2) of SAP Query
- Add a short name for the Year of Birth field from infotype 0002 and give it a short name (YBIRTH)
- Follow menu path Edit > Local field > Create and a dialog box will appear
- Give your new local calculated field a short name, field description, and heading
- Define the attributes of your new field by selecting icon
- Select the Complex calculation button
- In the Condition line, specify the expected value. You first list the short name you gave to the reference field (in the first step) followed by an operator and then followed by the value in single quotation marks.
Condition: YBIRTH > ‘1989’
8. In the Formula line, specify what value you want to output. In this case you want to output a icon, so you select the icon button to select the picture you want. The Formula line is then updated with the name of that icon (A flag in this example is called ICON_DEFECT)
9. Basically, you are saying that if the year of birth is greater than 1989, output a red flag for that record
10. To check your logic, select the Check icon
11. If no errors in your logic are found, select the green check mark icon to return to the Field definition dialog box
12. Select the green check mark icon to return to the Select Field (#2) screen
13. On the Basic List Line Structure screen (#5) be sure to add your new calculated field so that the field is included in your report output
14. Press F8 to execute your report to see your
flagged records! :)
Danielle Larocca, SpinifexIT
Connect with me on Linked In at www.linkedin.com/in/daniellelaroccasap
spinifex IT is the creator of Easy Reporter, the only SAP certified solution that runs live inside SAP for real time HR and Payroll reporting. Check it out for yourself online at www.spinifexit.com/easy-reporter/ or contact me for a live WebEx demonstration.