Adhoc Query
By Rajesh Kumar Burra
The InfoSet Query is a useful tool for maintaining queries within the SAP Query and is suitable for developing queries and for ad-hoc reporting.
InfoSet Query is suitable for reporting in all areas of the SAP R/3 system. When InfoSet Query is used in HR for ad-hoc reporting, the name Ad-Hoc Query is used instead of InfoSet Query.
Ad-Hoc query provides three different kinds of reports:
- Basic List – Simple reports
· Statistics – reports with statistical functions such as Averages, percentages etc
- Ranked List – for analytical reports
The first step in the process of creating an Ad-Hoc query is to create a Functional Area. Function area provides special views of logical databases. They determine which fields of a logical database can be evaluated in queries.
Go to tcode SQ03.
Select Query areas
Menu->Environment->Query areas
Select the radio button ‘Global area’.
Click on ‘Choose’
Create user group
Here you specify the users who should be authorized to run the query. A user group is always associated with a Functional Area.
– Go to the menu path Environment => User Group or SQ03 à Give a user group name in the screen. Specify the sap logins of the users whom you want to authorize for using the functional area and click on the Create button.
Select User group as ‘zdemo_user’ (Create Z user group).
Create
Go to Environment menu select INFOSET or go for tcode (SQ02)
Select infotype which u need (like above screen short)
Click on save and Click on generate button (red button).
Go back to main screen
Click on ‘Role/User group assignment’ tab
Select assigned table check box with User group which u already created.(zdem_user)
Save it and back…
Go to tcode for SQ01.
Query ‘zdemo_01’ (Create zname)
Click on ‘create’ button
Select assigned table check box with User group which u already created.(zdem_user)
Save it and back…
Go to tcode for SQ01.
Query ‘zdemo_01’ (Create zname)
Click on ‘create’ button
Pass title as Shortdesc..(demo for pa infotype)
- Save……
- Back….
Click on Infoset Query
Query is saved.
Click on continue….
- Back…
Click on Execute button (F8). In above screen we have selected selection screen as personnel number
Below you can see personnel numbers are displayed as Text Value with Name. It should display Personnel Number.
Go to SQ01
Select “only value” and save.
Save. Go back and execute.
Go to se93 to create Z Transaction Code.
Execute

























nice doc.....................
John
Thank you John
Thanks for sharing this with hcm community..superb!
no worries
kg
Thank you SAP enjoy
very good doc...
Narayan
Thank you Narayan
Hey Rajesh..
Nice doc and keep posting...
Vijay
Thank you Vijay Shankar
hi rajesh ...
very gud document
Thank you Jwala
Hi Rajesh,
Thanks for the document
Regards
Rahul
Pleasure to see your comment
Hi Raj,
Good document.
Regards,
Neha
Thank you Neha
Hello Rajesh,
Nice document, you saved my couple of hours.
Thanks Rajesh.
Thank you Harshal
Nice Document Rajesh
Thank you Anupama
Hi Rajesh,
Its very helpful document. One thing I would like to ask what value need to put in
D_SREPOVARI_EXTDREPORT, D_SREPOVARI_REPORT in case of having different name for query, infoset and usergroup.
Once, I had created zdemo for all , I was able to run the steps after SE93 successfully. But when I had distinct name to usergroup, infoset and query like zusergroup, zinfoset, zquery respectively, I was not able to run the after T-Code process. It generates error.
Please update, if I have made any mistakes in between the process.
Regards,
Ritu
Could you share screenshot of error to understand more
Hi Rajesh,
Thanks for posting very helpful document
Regards,
Ravi
Hi Rajesh,
thanks for A dhoc query documents. it make easy to use.
Thank you Akhilesh
Nice document, when ever i have a doubt in Adhoc query i go through this document.
Thank you.
Regards,
Prasad.
Thank you very much Prasad Kumar
Nice document Rajesh.
Thank you Bhagyashree Naik
Rajesh,
Very very useful document for me.
Thanks,
Aruna.
Thank you very much Aruna Kumari Chitipotu
Rajesh,
regarding ur document about Adhoc Query.
its clearly mentioned step by step config. to pull out the reports from Infotypes directly as it is right.
But can u give some more explanation about :
1. Statistics - reports with statistical functions such as Averages, percentages etc
2. Ranked List - for analytical reports
To get these system, should do some calculations and give us output right? since, These reports are useful for Management right?
You will be appreciated if you can get back to me in this regard.
Regards,
Aruna.
Really informative! Thanks for sharing 🙂
Thanks a lot Kanupriya Dhiman
Nice document Rajesh,
will be any document about switches in ad hoc query ?
Regards
Thank you
Nice document, when ever I have any doubt in Adhoc Query,I will go through this document.
Thank you very much,
Regards,
Naresh
Thank you
very nice document dear Rajesh,
but can you help me in build ad hoc approval for shopping cart, please?
Thank you
Please go through below thread
https://scn.sap.com/thread/3196512
Thanks for a very nice article.
The question in my mind, is what are good examples of why you need to do these adhoc queries?
What are the kinds of data that you need and why ?
Is use of this capability ever a challenge with auditors?
It is tool for building reports on basic data of an employee. You can capture fields in an Infotype for building a report
Example: Address Report, Bank Report , Date of Birth Report
Users will have access to tool . No challenge with auditors.
Hi Rajesh,
When i am saving the infoset after pressing the Genearte button, it is asking for package .
What package we need to provide ?
hi
Save it in ZSBD
Quick question, if I don't want to restrict this query to certain users and want to be available like a general report, then how do I assign the Z group to all the users?