Creating an Ad Hoc Query


After completing this lesson, you will be able to:

  • Create an ad hoc query

Ad Hoc Query

Ad Hoc Query is a simple but powerful tool for reporting on HCM data. Programming skills are not required.

Watch the video to see how an Ad Hoc Query can be built.

The Ad Hoc Query reporting tool supports InfoSets, which store data in components of SAP HCM, for example:

  • Master data
  • Time management
  • Payroll
  • Personnel planning and development

Ad Hoc Query Screen: Functions

InfoSets and user groups form the basis of Ad Hoc query. InfoSets are assigned to user groups which group users together. InfoSets enable you to group infotype fields and calculated fields together to meet your reporting requirements. From the hit list displayed in the List Viewer section, you can review your report before the final output. Queries can be saved and re-used.

Ad Hoc Query Overview

To create an Ad Hoc query, select one or more Selection and Output fields from the top left-hand pane (1). The chosen Selection fields will appear in the selection area (or output area) in the top right-hand pane (2). If fields have both values and texts, you can specify whether only the text, only the value, or both are used.

In the output preview section at the bottom of the Ad Hoc Query screen (3), you can display real data in the Output fields.

Unlike other reporting tools, the selection is made directly from the database, so data is reported in real time. Personnel numbers are only selected if they meet the specified criteria and if the user has permission to see the data.

Create an Ad Hoc Query

Business Example

As part of your job, you will occasionally need to extract HR data that is not provided by one of the standard reports. On these occasions you can build and run an Ad Hoc query.

Learn how to build and run an Ad Hoc query.


  1. Navigate to Ad Hoc query from the SAP Easy Access screen, choose Human ResourcesInformation SystemReporting Tools → double-click on S_PH0_48000513 – Ad Hoc Query. You can also enter S_PH0_48000513 in the Command field, or select the report link if saved in your favorites.

  2. Select the relevant InfoSet if necessary.

  3. Open the relevant Field group/fields in the top left pane, usually organized in infotypes. Select the relevant fields. Most fields have two selection options: "Selection" will add the field into the top right pane for you to choose a value or values, "Output" will add the field to the bottom of the screen, so that you can see how your report list will look.

    Organizational Assignment - these will be your main selection fields. Choose such fields as Personnel area, Personnel subarea, Employee group and Employee subgroup.

    Personal Data - choose such fields as Last Name and First Name for output.

  4. Enter/select the relevant value(s) for the fields that you chose as "Selection".

  5. Hit List – once you have made your selections, use the hit list to see the number of people/records that will be selected for your output list and display a list of the people in the hit list. Choose Hit list, then Display hit list.

  6. Once you have made the correct selections, choose Output. You will only see the results if you have permission for the data.

  7. Adjust the layout of the output list – choose Change Layout. Use the arrows in the Column Selection tab to move the displayed field columns up or down. Once you have them in the correct order, choose Adopt.

  8. Choose Back to return to the query screen. Choose Back to return to the SAP Easy Access screen.

Log in to track your progress & complete quizzes