---
description: &quot;The Ad Hoc Query is a tool for building reports and queries on basic data of an employee.It offers access to data of all SAP infotypes. &quot;
title: SAP AD HOC Query Tutorial (S_PH0_48000513)
image: https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query.jpg
---

 

[Skip to content](#main) 

The Ad Hoc Query is a tool for building reports and queries on basic data of an employee.It offers access to data of all SAP infotypes. This tool can process data linked to: o Time management o Organizational management o Compensation management o Training etc.

## SAP AD HOC Query Tutorial

**Step 1)** In the SAP Command prompt, Enter transaction **S\_PH0\_48000513**

[![SAP AD HOC Query](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query.jpg)](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query.jpg)

**Step 2)** In the next In the [SAP](https://www.guru99.com/what-is-sap-definition-of-sap-erp-software.html) screen,

1. Select a Work Area – queries linked to a **specific** client or to all clients
2. Choose a User Group – to access **available infosets**
3. Choose an Infoset **–** In the list select the desired infoset
4. Click the Check Mark Button

[![SAP AD HOC Query](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query1.jpg)](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query1.jpg)

**Step 3)** The SAP Ad-hoc query working panel is shown-

[](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query2.jpg)

 Overview of the various sections

1. **Field group/field**\=Where you define the selections and output fields
2. **Reporting Period** \=This is where you define the period for which the selected objects are to be retrieved.
3. **Selections** \= Once you have ticked a field in the “Selection” column in the “Field Group/Fields” section, it will appear in the “Selections” section where you can restrict the employees selected
4. **Testing the selections** \= to update the number of “hits” obtained by the query
5. **Functions**\=Some layout functionalities are accessible simply by using your mouse or via buttons located in the “Preview of Output”
6. **Main functions** \= create a new query, open existing query, execute a query

### Executing a Query:Choosing Output

1. The section field / group fields shows list of all available [infotypes](https://www.guru99.com/what-is-infotype.html)
2. Select the Infotye whose data you want in output
3. Select the Infotype field by checking “output”
4. Data is displayed at the bottom of the working panel

[](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query3.jpg)

### Choosing Input

It is possible to restrict or limit the population selected, by using any element. Once you have ticked a field in the “Selection” column in the “Field Group/Fields” section, it will appear in the “Selections” section from where you can set the restrictions.

[](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query4.jpg)

1. For Example, check the Selection Column for Year of Birth
2. It appears in the Selection Section
3. You may choose to restrict values via a pattern, single value, etc
4. Enter the restriction value

In case of multiple selections, the link between the selections is automatically **AND**

[](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query5.jpg)

 Above example will produce a list of women (Gender Key = 2) AND born in 1976

### Results

Click on output.

[](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query6.jpg)

 Results are displayed

[](https://www.guru99.com/images/sap/2010/10/SAP-AD-Hoc-Query7.jpg)

**Note:** Make sure you select correct Reporting Period for your Query

[](https://www.guru99.com/images/sap/2011/04/SAP-AD-Hoc-Query.jpg)

#### Summarize this post with:

ChatGPT Perplexity Grok Google AI 

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.** 

##### Sign up for the newsletter

Subscribe for Free 

You have successfully subscribed.  
Please check your inbox. 

![AI-Newsletter]() Chosen by over **350,000+** professionals 

[Scroll to top ](#wrapper)Scroll to top 

× 

Toggle Menu Close 

Search for: 

Search

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/sap-ad-hoc-query.png","url":"https://www.guru99.com/images/sap-ad-hoc-query.png","width":"163","height":"70","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/all-about-ad-hoc-query.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/sap-hr","name":"SAP - HR"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/all-about-ad-hoc-query.html","name":"SAP AD HOC Query Tutorial (S_PH0_48000513)"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/all-about-ad-hoc-query.html#webpage","url":"https://www.guru99.com/all-about-ad-hoc-query.html","name":"SAP AD HOC Query Tutorial (S_PH0_48000513)","dateModified":"2024-08-20T20:07:15+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/sap-ad-hoc-query.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/all-about-ad-hoc-query.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/kaelyn","name":"Kaelyn Flynn","description":"I'm Kaelyn Flynn, an SAP HR &amp; Payroll Consultant, offering tutorials on SAP HR functionalities and payroll process optimization.","url":"https://www.guru99.com/author/kaelyn","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/kaelyn-flynn-author.png","url":"https://www.guru99.com/images/kaelyn-flynn-author.png","caption":"Kaelyn Flynn","inLanguage":"en-US"},"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"@type":"NewsArticle","headline":"SAP AD HOC Query Tutorial (S_PH0_48000513)","keywords":"sap-hr, sap","dateModified":"2024-08-20T20:07:15+05:30","articleSection":"SAP - HR","author":{"@id":"https://www.guru99.com/author/kaelyn","name":"Kaelyn Flynn"},"publisher":{"@id":"https://www.guru99.com/#organization"},"description":"&quot;The Ad Hoc Query is a tool for building reports and queries on basic data of an employee.It offers access to data of all SAP infotypes. &quot;","copyrightYear":"2024","copyrightHolder":{"@id":"https://www.guru99.com/#organization"},"name":"SAP AD HOC Query Tutorial (S_PH0_48000513)","@id":"https://www.guru99.com/all-about-ad-hoc-query.html#richSnippet","isPartOf":{"@id":"https://www.guru99.com/all-about-ad-hoc-query.html#webpage"},"image":{"@id":"https://www.guru99.com/images/sap-ad-hoc-query.png"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/all-about-ad-hoc-query.html#webpage"}}]}
```
