Automating ADHOC query reports to generate Emails

Hi Experts
Hope you guys are doing fine.
I have a requirement where we need to automate the ADHOC query reports to trigger emails with the Excel attachment of the report to a set of users.
To explain in detail,we have some adhoc queries which are run manually on monthly basis(by our functional guys).Once the output report is generated,they used to download them into Excel document and send that to a set of users as an email attachment.
Now we are planning to automate the entire process,so that these query reports once set to run on monthly basis should trigger emails to set of users with the excel attachment.
Now,i am looking for solution on how to proceed on this.Since the program behind the query(which starts with AQ*) is not be a modifiable program,i can write any custom code here.Alternately,i planned to set a background job which runs the query and then use a  custom pgm which reads the spool no for the pgm and then to read the data from the spool into an internal table and then use a FM to send the internal table data as an email attachment.But wasn't sure of what FM's to use to read the spool no. and data from the spool.
Is there any alternate way to work on this or any suggestions on my assumed process would be really appreciated.

Ok, here's what you do:
- Go to T/C: SQ01 and find your query
- From the menu at the top select Query>More functions>Display Report Name (copy the report name)
- Go to Transaction SO23 and create a new shared distribution list - give it a name and title, click the dropdown on folder and click the create folder button, give the folder a name and save/green tick.
- Click on the Dist. list content tab and enter all the external email addresses that the report should go to ( the recipient type should be internet address or via internet or something like that)
- Go to Transaction SM36 and click on the Job wizard button, go through the wizard entering the program name we copied earlier. In the print parameters section make sure it is set to print immediately, then on the spool list recipients button select the dropdown box, select distributions lists and find the one you created earlier. Define the variants, periods, time etc etc
- When the job runs it will process the output via SAPConnect (transaction SCOT) you will be able to see the status of the emails by going to transaction SCOT and selecting the menu option Utilities>Overview send requests.
Job Done, Chillax
PS: remember the output type of the query in SQ01 needs to be set to excel or whatever you require otherwise a PDF/html attachment will be created in the email.
PPS: If SAPConnect is not set up in your system speak to your basis guy to set it up - If you don't have any basis resource, it is really easy to set up, plenty of guides around.

Similar Messages

  • Adhoc Query Report

    Hi SAPients..
    I have a n issue in Adhoc Query
    In Adhoc query report ( PQAH ), X person having authorization to see the folder Additional Personal Data (IT0077), but Y person can access the Adoc but could not see the folder (IT0077). Please guide what should I do to make the Y person can view the (IT0077) folder??
    Appreciate your support on this, Please guide me.

    Hi Shan,
    What I undertand is as follows:
    Person is having access to view IT77 and Y person is having access to t code - PQAH (Ad Hoc Reprot). you want to give Y person access of IT77.
    In this case you would need to add the concerned role to y person's SAP user id by which he ll get acces to maintain IT77 ands also can download the report. The role name you can get from your security team or GRC team.
    Hope this solves your query.
    Sarang Kulkarni

  • Adhoc Query report not working fine

    We have a customized infotype  9222 which stores the previous experience of the employees.
    Now I have created a adhoc query in which I have added this infotype.The problem which I am facing is when I put the Indian company codes and run the report, the report is working fine . But when I put a Ukraine Company Code and then run the report ; the report does not picks the experience details of the employees and it shows Zero Yrs and Zero months.
    I have checked in PA30 the experience details are maintained  for the Ukraine employees.
    Is their any setting in the system which allows the infotype for a particular company? or what may be the reason for the strange behaviour of the report towards a specific compant code. Please reply asap

    Hi ,
    Pls check do you have authorization or not for to create Object Directory entry.
    Thanks and Regards,

  • ADhoc query : reporting error

    Hi Experts
    I am getting an error with Adhoc query.
    When ever i open a report in the transaction code S_PH0_48000513,the query is not allowing me to open the report.
    Any help in this regard wud be appreciated.

    Please be sure that you are using right <b>Work Area</b> and <b>User Group</b>.select the query and double click on the infoset name. I hope it will work.
    please reward points if the answer helps you.

  • Can an Infoset (Adhoc) Query Report be Run using a Variant ?

    We have a lot of users that have access to infoset (adhoc) query tool but where they are not authorised to save queries in the system. They have the ability to create new reports and also open up existing reports using Open query button.
    My question is whether the user can run an existing report using the Variant if one exists and how they select to run the report with a variant, and also whether a user can edit a variant for an existing report.
    Any help on this would be much appreciated.

    The usersd do not have SQ01. They only have S_PH0_48000513 - Ad Hoc Query since SQ01 is a sensitive transaction as access to it should be restricted. Hence our users can go into adhoc query and open existing queries etc.
    I do not see any button Execute with Variant when in Infoset (Adhoc) Query view. Might you be able to advise?
    Thanks a lot

  • Education & Previous Employment in Adhoc Query

    Dear Experts,
    Can you tell us how to include education & previous employment (only the recent employer name) in adhoc query report in recruitment module.
    Request if anyone can help me with this.
    Have a nice day.

    did you build the infoset so that adhoc query can be built?
    which report you are referring to?

  • Adhoc Query : Error during selection; check the selection conditions

    We have a report set-up and which we want to run using our adhoc query report tcode S_PH0_48000513
    The report, has a few different selection criteria in it to look at all action IT screen data in the system for ee's in specific personnel areas. There is also a criteria to allow us to paste in specific employee numbers we are interested in. The issue I am facing is that over about 3000 ids, the system automatically returns me a message when I click on the Output button to run the report which states:
    Error during selection; check the selection conditions
    Message no. PAIS206
    I am not sure why this is happening. The selection criteria are fine and the other day I ran the report and I experienced no issues. The report ran successfully. Now though, if I try and paste in all the ids I am interested in (about 8000) I get this message straightaway.
    Can anything be done to overcome this issue?
    Any advice would be much appreciated.

    The message in full is:
    Error during selection; check the selection conditions
    Message no. PAIS206
    A runtime error occurred during dynamic selection.
    System response
    The runtime error will be caught; no short dump will be created. This error should not occur as a rule. However, very large select statements may trigger the runtime error SAPSQL_STMNT_TOO_LARGE or DBIF_RSQL_INVALID_RSQL. There is no way to prevent this happening. In this case, the error can only be caught.
    Check the selection conditions to see whether the error was caused because the option "Import from text file" included too many objects in the "Multiple selection" dialog. If this is so, you must limit the number of individual values.

  • OBIEE - Report an Image in Adhoc Query

    Hello Everyone,
    We are trying to generate an Adhoc query on an attribute with image. We are on We cannot get that to work.
    The column data type is BLOB.  Please share your ideas or experiences on reporting such data types.
    Thank you,

    Check this Oracle BI EE &amp;#8211; Displaying BLOB images &amp;#8211; Using Pl/SQL Gateway &amp;laquo; Business Intellig…

  • Where do we specify Report category in HR Adhoc query

    Hi All.
    We have a standard query which shows a selection screen which is different in Production. When I went into the program behind the query and saw the report category, it is different in both the environments.
    I am not able to find where do we specify report category in the HR adhoc query.
    Can anyone please guide?
    Also, how is this possible that a standard report has different report category in Development and production env. ?
    Any help would be appreciated.

    There is no place in query, to maintain report category. Whenever an query is created, this table gets updated with default report category depending upon the LDB used. Now if you want to change this default screen to some other screen, then this is the only table where you can change the report category for that query or program.
    According to me, you have to maintain this table only, if you want different report category, since there is no place in query where you can do this.
    Hope this helps.

  • Adhoc Query: Absence Leave report

    Hi All,
    I am trying to create a Query in Adhoc query for ABSENCE LIST.
    so i have added few columns:
    PERNR Value
    Personnel area Value
    Personnel area Text
    Personnel sub-area Value
    Personnel sub-area Text
    Company code Value
    Company code Text
    Postion name Text
    Attendance or absence type value
    Attendance or absence type Text
    1. Here when i pick the Position from infotype 0001 it is displaying some default position along with the position
    2. I need the list of employee who has taken leaves, and leave types are picked from infotype 2001. Here i am getting complete list of employees(employees who has not taken leaves)
    So can we prepare a report employees who went on leaves based on the above requirement.
    Please find the attachment.

    On a more serious note,
    A query is a simple spitting out of all the data, based on the fields you have selected, So if atleast one field has a valid value, and "Personnel Number" is one such field, you will get an output in the report.
    What you will have to do is to assign certain key fields as selection fields as well as output fields, when designing the Ad-Hoc query.
    Then use selection criteria to get out only the results you want, for example Absence Type = Annual Leave( don't want to type the abbreviation here), date range of BEGDA - 01.01.2014 - 30.04.2014, for example. Using Employment Status as a Selection field but not an Output field can help with ensuring inactive employees (i.e people with default positions) are not selected.
    I often find that in any case, one always has to download the query output into Excel and do some final manipulations using filters and pivots etc.
    Also, play around with the Key Date  field,  in the query design screen - see what happens if you use "Today" rather than a wider date range.
    Hope this helps.

  • Execute generated query report in RSRT

    Hello experts,
    I tried to execute the generated report for a query in transaction RSRT and it failed ("query not found on server" was the error). Now my question is more general - what is this report for? Is it just a "background program" for a query and should not/cannot be executed in SE38? Can you execute your generated query programs in SE38?
    Thanks in advance!

    Hi Daniel,
    Basically the queries are Subroutine Pools and you can call this in ABAP.
    Please see the following links.
    Re: Execute generated query report in RSRT
    I hope this will help you to get more clarity as well to me to get more points!!!!

  • How Transportation of Adhoc Query is done through RSAQR3TR report.

    How Transportation of Adhoc Query is done through RSAQR3TR report.i want to transport a new usergroup, new infoset and a query from Develpment to Quality and Production.
    I have gone through the documentation of the RSAQR3TR report and as well as the SAP library material, but still i am confused.
    Please help

    Hope this helps.

  • Unable to report adhoc query output on HRP tables

    Hi All,
    I am using adhoc query to report the data from HRP table (customised) but the data is not being picked even though the table has the records. The fields from the field group and the infotype fields are properly mapped but the output is blank.
    Any pointers/suggestions on how we can achieve this would be helpful.

    @ semvladigo : Thanks for the reply. Could you please let me know further info on the standard functionality.
    @ Albert : Thanks for the input. I am in PA and using PNPCE but it is not working with this LDB. 
                      When I query (in PCH) I am not getting results when I select 'ALL' in the reporting period.
                      It worked fine when infoset built in PCH LDB with reporting period other than 'ALL' (like Today, Keydate).
                      Please advise.

  • Adhoc Query on MSS Report

    Hi Experts,
    Would like to know, how to add Adhoc query on MSS reports? Tried to search the thread but couldn't find anything.
    Really appreciate kind guidance on the same.

    You can remove it by following ways
    Go to SPRO
    Then follow following path
    Integration with Other Components -> Business Packages / Functional Packages -> Manager Self-Service (mySAP ERP) -> Reporting -> Set Up LaunchPad
    and execute
    then you can get the list of the REports
    over there you can see "Birthday List" Report and Deactivate it
    Please execute this steps before the executing the steps i have mentioned above, this will activate the reports used for MSS. Then gofor moving the unwanted reports unactive folder. Just what you have to do it select the unwanted report and move it down to the inactive folder.
    1. In the SAP HCM System choose:
    SAP Easy Access Menu
    Transaction SE38
    2. In the ABAP Editor: Initial Screen enter the Program FPB_LP_WRITE_ENTRIES and choose Execute.
    3. In the Report FPB_LP_WRITE_ENTRIES screen select the MSS Reporting and MSS with Folders options and deselect the checkbox Test Run.
    4. Choose Execute. The sample entries are entered in the Report Launchpad in the portal.
    5. Log on to the portal with User manager1 and check if the sample entries are displayed.
    6. In the ECC system leave the transaction and go back to the SAP Easy Access Menu.
    7. Enter transaction PWPC_CONV_MDT_TO_LPA in the Command field.
    8. In the Report to convert MDT table entries to LPA table entries screen, enter the MDT Scenario RPT0 and deselect the Test run checkbox.
    9. Choose Execute. The list in the next screen shows the reports which have been added to the Report Launchpad.
    Do not forget to select MSS with Folders for the FPB_LP_WRITE_ENTRIES report. Otherwise you may get short dumps while editing the report launchpad, because the reports coming from the Manageru2019s Desktop do not have folders.

  • SCCM 2012 R2-CU3 Collection Query not a report to generate Computers no longer logon to Active Directory for more than 90 Days.

    Dear Brothers,
    I want to use SCCM to have a
    Query Collection to generate computers no longer active by detecting more than 90 days of no logon to our AD (Dead or not Pinging but still in AD), after this activity I will delete this computers
    to completely clean both AD and SCCM records as Well.
    Why instead of Reports I prefer collection is because, I want it to be more Dynamic and once you open the console the computers will be displayed immediately.

    It is not possible for a collection to be more dynamic than a report. If anything the collection will be behind what is listed in a report.
    How exact do you think that you determine that a PC is not ping able via a collection? This might be possible via a report but it will be a very, very complex report to do this.
    As for logon details this is NOT collect by CM12 by default and it is could be update 15-22 days out of sync with reality.
    If I remember right there are a few scripts that will do this for you available via the favorite search engine.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    Thanks Garth,

Maybe you are looking for

  • After years of use, my ipod classic will not sync with itunes on any computer. I have wiped the ipod clean and it still won't sync. what to do?

    I had about 80 songs on my ipod and it worked fine until one day i purchased some new music from itunes and discovered that it wouldn't sync. I tried various things and finally wiped the ipod clean thinking it would sync then. It doesn't and now I ha

  • CUE 8.6.3 ringing busy

    Hi, We are having an issue where CUE has stopped working.  It had been working just fine but now when we call it we get a busy signal.  I tried to reset the module but still have the same issue.  When I do a service-module integrated-service-engine 0

  • Using ichat on a mac and wanting to video chat to someone using a pc

    i have a macbook pro and heard that using i chat i can video chat to my friends who all use pc's. that's fine but what software will they need to install to talk back... or can install some other software to get my camera working to video chat with t

  • Batch Canvas Resize?

    I have a large batch of varying image sizes, such as 1280 x 853, 800 x 600. I want to get them down to 200 x 200. I can do the regular scale to size and get all images to a 200px width. But now the dimensions are all 200 x 133 and 200 x 150. I need t

  • Allow Frame formats to be imported

    Currently, when importing formats into a document, the only way that frame properties can be imported is from a Reference page. The frame properties that are imported are only the same size as what is on the Reference page. Feature Request: Include t