Skip to Content
Author's profile photo Rajesh Kumar Burra

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. 

/wp-content/uploads/2013/09/clip_image002_272664.jpg

Select Query areas

Menu->Environment->Query areas

Select the radio button ‘Global area’.

/wp-content/uploads/2013/09/clip_image003_272665.jpg

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).

/wp-content/uploads/2013/09/clip_image004_272690.jpg

Create


/wp-content/uploads/2013/09/clip_image005_272691.jpg

Go to Environment menu select INFOSET or go for tcode (SQ02)

/wp-content/uploads/2013/09/clip_image006_272692.jpg

/wp-content/uploads/2013/09/clip_image007_272693.jpg

Select infotype which u need (like above screen short)

/wp-content/uploads/2013/09/clip_image008_272695.jpg

Click on save and Click on generate button (red button).

Go back to main screen

Click on ‘Role/User group assignment’ tab

clip_image010.JPG

clip_image012.JPG

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

clip_image012.JPG

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


/wp-content/uploads/2013/09/clip_image014_272708.jpg


/wp-content/uploads/2013/09/clip_image015_272709.jpg

Pass title as Shortdesc..(demo for pa infotype)

  1. Save……
  2. Back….

Click on Infoset Query

/wp-content/uploads/2013/09/clip_image016_272710.jpg

/wp-content/uploads/2013/09/clip_image017_272711.jpg

Query is saved.

Click on continue….

  1. Back…

Click on Execute button (F8). In above screen we have selected selection screen as personnel number

/wp-content/uploads/2013/09/clip_image018_272712.jpg


Below you can see personnel numbers are displayed as Text Value with Name. It should display Personnel Number.

/wp-content/uploads/2013/09/clip_image019_272713.jpg

Go to SQ01

/wp-content/uploads/2013/09/clip_image020_272714.jpg

Select “only value” and save.

/wp-content/uploads/2013/09/clip_image021_272715.jpg

Save. Go back and execute.

/wp-content/uploads/2013/09/clip_image022_272717.jpg

Go to se93 to create Z Transaction Code.

/wp-content/uploads/2013/09/clip_image023_272718.jpg

/wp-content/uploads/2013/09/clip_image024_272719.jpg

/wp-content/uploads/2013/09/clip_image025_272720.jpg


/wp-content/uploads/2013/09/clip_image026_272721.jpg

/wp-content/uploads/2013/09/clip_image030_272722.jpg

/wp-content/uploads/2013/09/clip_image031_272723.jpg

Execute

/wp-content/uploads/2013/09/clip_image032_272724.jpg

Assigned tags

      43 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      nice doc.....................

      John

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you John

      Author's profile photo Former Member
      Former Member

      Thanks for sharing this with hcm community..superb!

      no worries

      kg

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you SAP enjoy

      Author's profile photo Former Member
      Former Member

      very good doc...

      Narayan

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you Narayan

      Author's profile photo Former Member
      Former Member

      Hey Rajesh..

      Nice doc and keep posting...

      Vijay

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you Vijay Shankar

      Author's profile photo Former Member
      Former Member

      hi rajesh ...

      very gud document

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you Jwala

      Author's profile photo Vijay S
      Vijay S

      Hi Rajesh,

      Thanks for the document

      Regards

      Rahul

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Pleasure to see your comment

      Author's profile photo Former Member
      Former Member

      Hi Raj,

      Good document.

      Regards,

      Neha

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you Neha

      Author's profile photo Former Member
      Former Member

      Hello Rajesh,

      Nice document, you saved my couple of hours.

      Thanks Rajesh.

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you Harshal

      Author's profile photo anupama joshi
      anupama joshi

      Nice Document Rajesh

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you Anupama

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Could you share screenshot of error to understand more  

      Author's profile photo Former Member
      Former Member

      Hi Rajesh,

      Thanks for posting very helpful document

      Regards,

      Ravi

      Author's profile photo Former Member
      Former Member

      Hi Rajesh,

      thanks for A dhoc query documents. it make easy to use.

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you Akhilesh

      Author's profile photo Former Member
      Former Member

      Nice document, when ever i have a doubt in Adhoc query i go through this document.

      Thank you.

      Regards,

      Prasad.

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you very much Prasad Kumar

      Author's profile photo Former Member
      Former Member

      Nice document Rajesh.

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you Bhagyashree Naik

      Author's profile photo Former Member
      Former Member

      Rajesh,

      Very very  useful document for me.

      Thanks,

      Aruna.

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you very much Aruna Kumari Chitipotu

      Author's profile photo Former Member
      Former Member

      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.

      Author's profile photo Former Member
      Former Member

      Really informative! Thanks for sharing 🙂

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thanks  a lot Kanupriya Dhiman

      Author's profile photo Former Member
      Former Member

      Nice document Rajesh,

      will be any document about switches in ad hoc query ?

      Regards

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you

      Author's profile photo S V Naresh
      S V Naresh

      Nice document, when ever I have any  doubt in Adhoc Query,I will go through this document.

      Thank you very much,

      Regards,

      Naresh

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you

      Author's profile photo Former Member
      Former Member

      very nice document dear Rajesh,

      but can you help me in build ad hoc approval for shopping cart, please?

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

      Thank you

      Please go through below thread

      https://scn.sap.com/thread/3196512

      Author's profile photo Former Member
      Former Member

      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?

      Author's profile photo Rajesh Kumar Burra
      Rajesh Kumar Burra
      Blog Post Author

           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.

      Author's profile photo Sekhar Sekhar
      Sekhar Sekhar

      Hi Rajesh,

      When i am saving the infoset after pressing the Genearte button, it is asking for package .

      What package we need to provide ?

      Author's profile photo MSR SAP
      MSR SAP

      hi

      Save it in ZSBD

      Author's profile photo Manish Agrawal
      Manish Agrawal

      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?