Write an Adhoc Report (PQAH)
Purpose
Use this procedure to Create a new Ad Hoc Report from scratch for a reporting User Group.
Note Any Ad Hoc report created within a reporting User Group will be available to all users in that group.
Trigger
Perform this procedure when you want to create a report on Master Data, which is stored against employees in the system.
Prerequisites
Your Master Data must already exist within the system.
Your user must be assigned to a User Group - this is carried out by your systems administrator.
Navigation Path
Use the following navigation path(s) to begin this transaction:
•  Select Processes è Human Resources è Enquiries è Adhoc Report Writer to go to the HR Adhoc Query screen.
•  Select Processes è Payroll è Enquiries è Adhoc Report Writer to go to the HR Adhoc Query screen.
Helpful Hints
Critical Adhoc Query can also be executed from within the Manager's Desktop and from within the Human Resources Information system.
Reference For further details on the Human Resources Information System refer to procedure Using the Human Resources Information System.
Reference For further details on the Manager’s Desktop refer to procedure Using the Manager’s Desktop.
Reference For details on executing reports please refer to procedure Run an Adhoc Report.
Example
In this example you will write an Ad Hoc Report using the following reporting functional groups and fields therein.
•  Key fields
•  Personal Data
•  Organisational Assignment
•  Basic Pay
 
•  You will use selections for Basic Pay
•  Salaries from £20,000 to £40,000 inclusive.
 
•  You will execute the Adhoc Report
•  You will save the Adhoc Report to run on another date.
Field Description Tables
The R/O/C column of each Field Description table indicates whether the field usage is:
R - Required in SAP.
O - Optional in SAP.
C - Conditional in SAP.
Procedure
1. Start the transaction using the navigation path.
screen  SAP Easy Access Main Menu
2. Double click Adhoc Report Writer to take you to the HR Adhoc Query screen.
screen  HR Adhoc Query
Note The screens, or infotypes, listed on the left side of the screen are dependent on your user settings; for example if you are an HR User you will see different information to a Payroll User.
3. Create a New Report
Note It is not Mandatory to create all reports from scratch; the system comes supplied with a number of standard reports which can be selected using Image rather than using create. Such reports can have print fields and selection fields added or removed as required. When saving these reports to ensure the template report is not overwritten, select è Ad Hoc Query è Save as instead of normal Save save.
screen  HR Ad Hoc Query
3.1 Click Image to go to the Create New Query - Functional Area Selection screen.
screen  Create New Query - Functional Area Selection
3.2 Complete the following fields:
Query area
User group
 
Note According to your access on the system you may be assigned to one or more of the following reporting User Groups. You should select the one you require.
HRUSERGRP for all HR Fields.
HRNOPAY for all HR except fields which contain Pay Information.
HGHRREC for Recruitment fields.
PYADM for Payroll fields.
 
3.3 Click Image to the left of the Functional Area in which you wish to create your Ad Hoc Report.
Critical When creating new Ad Hoc Reports you should use only the following Functional Areas.
HRUSERGRP_FA for all HR Fields.
HRNOPAY_FA for all HR except fields which contain Pay Information.
HGHRREC_FA for Recruitment fields.
PYADM_FA for Payroll fields.
screen  Create New Query - Functional Area Selection
3.4 Click Image to confirm your entry. This will ensure that the correct Functional Groups appear for selection.
screen  HR Ad Hoc Query
4. Select Fields to print.
screen  HR Ad Hoc Query Selection
4.1 Expand the Functional Group that contains the Field you wish to print. Do this by scrolling the window until you find the correct Functional Group and clicking Image to the left of it.
screen  HR Ad Hoc Query Selection Fields
Note You are presented with 3 columns of Image check boxes.
Column One represents Selection or Only If Fields.
Column Two represents fields to print.
Column Three represents text descriptions.of Coded fields to print.
4.2 Click Image In column Two for the Field You wish to Print. In this case First Name.
screen  HR Ad Hoc Query
Note Note the field is now checked and example output is beginning to build in the bottom window on the screen.
4.3 Repeat from Step 4 for all the fields you wish to print in the report.
Example:
Personal Data è First name
Personal Data è Last name
Key fields è Personnel number
Organisational Assignment è Payroll area
Organisational Assignment è Payroll area text
Basic Pay è Annual salary
screen  HR Ad Hoc Query
Note You can change the Column Order in the bottom window by selecting a column and then dragging and dropping it in the position you require. You can also sort a column by right clicking it and following the on screen selections. Report details can also be sorted and manipulated after report execution.
5. Select selection fields
screen  HR Ad Hoc Query selection
5.1 Expand the functional Group that contains the field you wish to use as a selection field. Do this by scrolling the window until you find the correct Functional Group and clicking Image to the left of it.
screen  HR Ad Hoc Query selection
Note Note the Annual Salary is already selected for display.
Note You are presented with 3 columns of Image check boxes.
Column One represents Selection or Only If Fields.
Column Two represents fields to print.
Column Three represents text descriptions.of Coded fields to print.
5.2 Click Image In column One for the Field you wish to select against. (In this example, Annual salary.)
screen  HR Ad Hoc Query
Note Note the Annual Salary is now presented as a selection field in the window on the right of the screen.
Note In this example, you require a report on employees with salaries from £20,000 to £40,000 inclusive.
Note You can select single operations by clicking Image in the Opt (Option) column. If this were sufficient, you could use the following operators:- equals; greater than or equal to; greater than; less than or equal to; less than and not equal to.
In this example, you will select employees within a salary range.
5.3 Click Image to go to the Multiple Selection for Annual Salary screen.
screen  Multiple Selection for Annual Salary
5.4 On the Multiple Selection for Annual Salary screen there are 4 tabs; clickImage.
Note The tabs can be used as follows:-
Tab
Description
Image
Use Operators for single values. Any entries here will be included in the report output.
Example: Greater than 20000
Image
Use limits for values. Any selections here will be included in the report.
Example: 20000 to 40000
Image
Use Operators for single values. Any entries here will be excluded from the report output.
Example: Less than or equal to 20000
Image
Use limits for values. Any selections here will be excluded from the report.
Example: 20000 to 40000
 
5.5 Enter 20000 in the left Value field (from) and 40000 in the right Value field (To). Click Image to confirm your entry.
screen  Multiple Selection for Ad Hoc Query
Note You are now selecting only Employees who have Annual salary over 20000 and less than 40000 inclusive
5.6 Click Image to confirm your entries.
screen  HR Ad Hoc Query
Note Note the icon to the right of the Value field Image now has a green bar on it to indicate that there are additional selections behind it.
5.7 Select Today in the Reporting period panel.
Note You can select any period for your Ad Hoc report data selection.
5.8 Click Image to determine how many records meet your selection criteria.
screen  Hit List
Note In this example there are 14 employees who, as at today's date, have a basic pay between £20,000 and £40,000 inclusive.
5.9 Repeat Step 5 for any further selection criteria you require.
6. Click Image to run your report.
screen  HR-AHQ dd.mm.yyyy/hh:mm:ss NNNNNN
Critical Note the name of the Query, and consequently the heading, has been automatically generated. Once a report has been saved and re-opened it displays the Title as it's heading. See Step 9
Reference For details on report output processing options please refer to procedure Run an Adhoc Report.
7. Click Go Back to return to the HR Ad Hoc Query screen.
screen  HR Ad Hoc Query
8. Click Save to go to the Save Query screen to save your Ad Hoc Report.
screen  Save Query
9. Complete the following fields:
Name
Title
 
Note The Title field will be used as the heading for the report once the report is saved and re-opened at a later date.
10. Click Image to confirm your entries.
screen  HR Ad Hoc Query Employees with Salaries 20000 to 40000
Note The system displays the message, "Query RJP_SALARY_1 was saved in user group HRUSERGRP".
11. Click Go Back to return to the SAP Easy Access Main Menu screen.
12. You have completed this transaction.
Result
You have written, saved and executed an Ad Hoc report.