Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Home If your browser does not support the SDS Knowledge Base menu, click here for an alternative.
Knowledgebase
About SDS
Links
Sitemap
Knowledgebase
Ad Hoc Query
Search Q
Ad Hoc Query, transaction code S_PH0_48000510, is very useful tool when producing reports from Personnel Administration and Organis ational Management. Queries (or reports) in SAP are s plit into Query Areas, Us er Groups, Infosets, and Queries. Query Areas define whether the report is available cross client (Global Area) or only in the client that it is built (Standard Area). If SAP is set to Global Area, then it is not pos sible to see any reports built in the Standard Area and vice versa. Us er Groups define which groups of end users can see different infosets. Infosets define which infotypes and which fields within thos e infotypes you can report on. Infos ets are generated via SAP Query, transaction code SQ01. Queries are the actual reports that an end-user can run within SAP, these can be s et up in SAP Query or Ad Hoc Query. When you first enter Ad Hoc Query you need to select which Area, User Group and Infoset you want to us e to run your report;
Your Input
We are always up our articles and a new ones to the li Please let us kno is a particular arti would like to see.
When running a report in Ad Hoc Query, you must specify which fields you would like to use as a sele ction and which fields you would like to output. The s election fields define which employees are going to appear in your report; for example, if you wanted to find a list of females above the age of 65 within a company you could use gender and date of birth as selection fields.
The next step is to define what values of the gender field and date of birth are valid for the report. In the cas e of the above report, the gender key needs to be 2 female and the date of birth must be less than the exact date 65 years ago. When a selection is made on the left of the screen the relevant fields will appear on the right of the screen, this is where the values are input.
Once you have selected your input values , you must define the time period that you would like to rep ort on. SAP defaults to todays date, but it is possible to define any period of time. This can be us eful when you would like to report on who had an absence in April 2007, for example. To select the date parameters select the Reporting period button at the top right of the screen. By clicking on the drop down box you can select the option relevant to your report. To select a certain period (April 2007 for example, select
down box you can select the option relevant to your report. To select a certain period (April 2007 for example, select other period and input a s tart and end date.
When you have defined all the data and the date parameters required for your report, you need to select your output fields. For example, you might need to know the name, employee number and work place of every lady o ver the age of 65; the outputs to your report would be the fields with this information in them.
Before you output your report it is good practice to check how many people have been selected by your selection fields, this normally gives a good indication as to whether your selections are correct if you expect to h ave 10 people in your report and you have 150 then it is likely at least one of the selection fields is incorrect. To check how many people have been selected by your report, select the Hit List button.
Here the report has selected one pers on, i.e. there is one female above the age of 65 in SAP. To s ee the employees name and number, select the glas ses, to res et the hit list select the bin. When you are happy with the report you have built and want to see the output, select the output button at the top of the screen:
You can now save this report to your PC by s electing the Save to Local File button;
If the report you are building is likely to be run on a regular basis, for a headcount, then you s hould save it as a query, simply by selecting the save button at the top of the selection/output screen. You can then open the report and re-run it without needing to make all your selections again. If you need to run 2 separate reports and compare them to find out the intersection (employees in bo th reports), the union set (employees in either of the reports ) or any employee who is one report and not the other then this can be done through SAP Query. For example you might need to know anyone who was sick in April 2007 and who isnt a female over the age of 65, this could not be done simply by running one report. To compare 2 reports (report A and report B), you first mus t build report A and store the results and the build report B and s tore the results. To do this select the Extras menu from the top of the screen and choos e Show set operations . You will notice tabs appear in the right of the screen, and two extra buttons appear next to the Hit list button.
Query Tools Data Tools Human Resources FI/CO Cross System Miscellaneous BW
These two buttons perform the s ame function as the Hit list button, i.e. they work out which emplo yees are s elected by a report; but they also store the results of the hit list, meaning you can have a hit lis t for report A and a hit list for report B and compare them. The blue button stores employees into Set A and the yellow button stores employees into Set B. To store the 2 hit lis ts s imply build report A and select the blue button, then build report B and s elect the yellow button. Now choose Set operations
As you can s ee, report A (females over 65) has 1 person in it, and report B (anyone absent in April 2007) has 3 people in it. You can now choose one of the operations and select the Carry out operation button. The result of the operation will be s tored in the Resulting set - from here you can see that only 2 people were absent in April 200 7 not including females over the age of 65. You can save the res ults to set A / set B again and do another iteration if required by selecting the Copy resulting set button.