The basic mode of operation of Ad Hoc Query consists of the following steps:
- Define one or more selection criteria and then start the selection. The result of this selection is a set of objects, such as persons, applicants, business events, or positions.
- Output the data as required for the selected objects.
Ad Hoc Query Screen
The Ad Hoc Query screen is divided into the following main areas:
When working with Ad Hoc Query, proceed as follows:
- The field groups and fields of the current InfoSet are displayed on the left of the screen. This part of the screen is used to select the selection and output fields.
- The right side of the screen enables you to determine selection values and execute your selection.
- The lower part of the screen contains an output preview.
- Select the selection and output fields in the overview tree.
- Enter a value and choose a selection option, if necessary.
- Execute the selection (the hit list is determined by selecting objects that match the selection criteria).
- Format the output in the Output preview.
- Access the output.
InfoSets for Ad Hoc Query

The InfoSets required for Ad Hoc Query are created and managed in SAP Query. When you create an InfoSet, you select the logical database on which it is based, and determine the infotypes that it includes. The infotypes are subsequently displayed in the InfoSet as field groups. Once you have selected your infotypes, you determine the fields of each infotype to be included in the field group.
The following scenarios illustrate how the InfoSet determines the objects that you can select with Ad Hoc Query:
- InfoSet based on PNP or PNPCE
- The InfoSet based on the logical databases PNP or PNPCE enables you to use Ad Hoc Query to select employees and then output data on them.
- You can include Personnel Planning infotypes in these InfoSets. Consequently, you can use them to output person-related personnel planning data on the persons selected.
- You can also use these InfoSets to report on payroll results.
- InfoSet based on PCH
The InfoSet based on the logical database PCH enables you to use Ad Hoc Query to select objects of one object type, such as business events, qualifications, or positions. When you create the InfoSet, you determine the object type.
Choose Selection and Output Fields
To access data in the system, Ad Hoc Query uses an InfoSet that provides a view of data in specific areas of HR. The view is structured by infotype. The InfoSet is displayed as an overview tree on the initial Ad Hoc Query screen.
You can select the selection and output fields by using drag and drop. To do so, select one or more fields and then drag them to the Selection or Output area.
If the selection and output fields have values and texts, you can use the text, the value, or both in the following ways.
You can choose the selection field in the Selection column of the overview tree. The field is then copied to the list of selection criteria on the right of the screen. If you use more than one selection criterion, they are linked by the AND logic. For example, by using the City and Age fields, you can select all persons who live in London and are 25 years old. If you select a field in the Selection column, you can use it as a selection field.
You also choose output fields in the overview tree. The fields are then copied to the output preview as columns. You can choose output fields either at the same time as you choose selection fields or afterwards. You can choose the output field from field groups as required.
You can output field contents as values (value output) and sometimes as text (text output). For example, you could specify the form of address key as value: 01, text: Mr; value: 02, text: Ms. If in doubt, specify both. The text often conveys more meaning. If you are a power user, you may require only the values.
The number of selection criteria and output fields that you have chosen is specified in the overview tree for each field group.
Treatment of Text Fields
If object selection has been switched off and values and texts exist for a field, you can select objects using values or texts. For example, you can select personnel area Frankfurt instead of personnel area 1000.
Note
You can treat the text fields in the following ways:
- Include user-specific settings for using text fields
- Override settings for field selection
For the output, you can always use the value and the text, when available.
You can choose a selection or output field by using the following methods:
- Select using Drag and Drop → User setting
- Select using Checkboxes → User setting
- Select using the context menu and choose between Value, Text or Value, and Text