SQ01- AdHoc Queries

Is there any way we can access data about the ad hoc reports we use.
Specifically we would like to know author, creation date, last run date, infoset, selection items and displayed fields.
It is possible to access this information on an individual basis by selecting Description in txn SQ01 however we want to be able to access this
data for all reports.
Regards
Ranjith

Hi Ranjith,
You did not state the system you are in, but from 4.7 on there is a standard functionality to Log Report Starts.  To turn this on you must link the infoset to logging via transaction SQ02 --> Extras.  All queries from that infoset will then be logged whether run via Ad Hoc or SQ01.  The log will show the query area, infoset, user, date and time, selection fields and values and output fields.  It is available in  in user group /SAPQUERY/SQ report LIST_01.

Similar Messages

  • Adhoc Queries

    Hello,
    I have one requirement, wherein I have to give access to users of two SAP Adhoc Queries.
    These queries are assigned to a User Group, which are assigned to users through SQ03.
    Due to some limitations we cannot create a custom TCode for these two queries.
    So, is there any way out through which we could provide the users access to these two specific queries through SQ01 by assigning them the specific User Group through SQ03 but the users should not be having access to other queries that are present in that specific User Group.

    Hi Aditi,
    I do not see any Personalization Object Key except SAP_QUERY_USERGROUP and that assigns user group to a role.  Even then user will have access to all the queries in the Infoset assigned to that User group. If you are going to create your personalization key with say Query and User then there is a need for application development.
    Please go through the post - [Use of Personalization Tab in PFCG; where Bernhard has posted some links regarding this topic. Maybe that could help a little.
    In my opinion it would be easier to get a query created in Dev and restricting it there then the other way around. Also how are u restricting the users from creating other queries ? Are they restricted to execute SQ01 ?
    Also I am confued about the underlying programs that you mentioned. From where does program come into picture? It is just a query pulling data from Infoset. To me it seems functional guys trying not to do their job when in the first place they only need the restriction on the queries.

  • SQL 2008 R2 standard reports - question about server dashboard and what it refers to as "adhoc" queries

    So I have started looking at some of the standard reports available with SSMS and in particular, the "server dashboard".   One thing that caught my attention were the charts that referred to "adhoc" queries.  I wondered how
    those were being defined, and as I expected, they are most likely those statements not in a stored procedure.  This was answered in
    this thread.  
    On a particular server Im interested in, this % value is well over 50% and the primary applications that interact with the databases on this system are Microsoft based products such as Dynamics and another commercial application which I know uses hundreds
    of stored procedures.  Now, Im sure there are some sql statements being used, possibly "dynamic" type sql, by these applications, but would the metrics really be skewed this far?
    What these charts tell me, with the "adhoc" statement types pushing CPU and Disk I/O %  this far, is that there is a BUNCH of these statements being run against the various databases.  The disk I/O might be a bit off since I only recently
    added dozens of missing indexes, but my question is this:
    With the "adhoc" type statements taking up this much of the CPU and Disk resources, can we say that there are likely a lot of these going on ?  I suppose one way to find out is to launch profiler and listen in while there is moderate
    to heavy user activity.
    Thoughts?

    Hello,
    Adhoc queries are DML statements with not parameterization. Sometimes users use this statements, and sometimes these statements come from applications.
    Use Query #2 on the following link to identify those adhoc queries:
    http://mssqlfun.com/2013/04/08/dmv-5-queries-runing-are-adhoc-or-proc-single-or-multi-use-sys-dm_exec_cached_plans/
    Identify if those adhoc queries belong to specific users or applications.
    One of the options you have to deal with is is the following configuration option:
    sp_CONFIGURE 'show advanced options',1
    RECONFIGURE
    GO
    sp_CONFIGURE ‘optimize for ad hoc workloads’,1
    RECONFIGURE
    GO
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Deletion of adhoc queries.

    Hi All,
    we have a scnario wherein, a query catalog is created for a user. The catalog contains many adhoc queries, the user can delete or retain them. After the query is deletd or retained, a entry is generated in a Z table. Is there any FM or Prgrm which can automate this process of deleting the entry from the Z table over a period of time?.
    Thanks & Regards,
    Nikhil.S

    hi arun,
    i will make my requirement more clear.
    We want to automate the deletion of the ad hoc queries.
    We have the list of all the queries to be deleted in a Ztable and we want a program in which we can pass the values one by one and the program deletes the query from database.
    The program COMPONENT_REORG refers to FM 'RSZ_DB_COMP_REORG_AS_POPUP' which gives a pop up asking for the inputs.
    we also refered to FM 'RSZ_DB_ELT_DELETE ' which caters more to our needs as in this FM we need to pass values.
    but we are unsure about how to pass the value of a query to the FM.
    will appreciate your help.
    thanks & regards,
    nikhil.s

  • Query to find adhoc queries taking high cpu on server

    Hi,
    I want to find all the adhoc and other queries consuming high cpu on sql server. sys.dm_exec_cahched_plan will only have cached queries and not the currently running ones.

    Hi Preetha7,
    According to your description, if you want to identify the most expensive SQL Server queries based on the cumulative CPU cost, you can use the DMVs of the sys.dm_exec_sql_text , the sys.dm_exec_query_plan and sys.dm_exec_query_stats. For example, you can
    refer to the following T-SQL statement.
    SELECT TOP 20
    qs.sql_handle,
    qs.execution_count,
    qs.total_worker_time AS Total_CPU,
    total_CPU_inSeconds = --Converted from microseconds
    qs.total_worker_time/1000000,
    average_CPU_inSeconds = --Converted from microseconds
    (qs.total_worker_time/1000000) / qs.execution_count,
    qs.total_elapsed_time,
    total_elapsed_time_inSeconds = --Converted from microseconds
    qs.total_elapsed_time/1000000,
    st.text,
    qp.query_plan
    FROM
    sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st
    CROSS apply sys.dm_exec_query_plan (qs.plan_handle) AS qp
    ORDER BY qs.total_worker_time DESC
    Or you can run the "Performance - Top Queries By Total CPU Time" report in SSMS. In addition, you can use SQL Server Extended Events session for troubleshooting the high consumed of CPU time. For more information about finding currently session that is costing
    high CPU.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/cb3e29ca-f1ef-4440-8f1a-db4924a43c5c/find-currently-session-that-is-costing-high-cpu?forum=sqldatabaseengine
    http://blogs.msdn.com/b/batala/archive/2011/07/23/troubleshoot-high-cpu-issue-without-using-profile-traces.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • BW Authorisation on Adhoc Queries

    Hello All
    An authorisation question on BW. We want to give BW users the the permissions to save queries (created using the Adhoc Query Designer) to a designated role. Further, users should only be limited to modifying their own queries and denied modify access to others' queries.
    If any of you have done this, is there a particular Authorisation object I should be looking to make the following restrictions:
    1. Allow users to save to a particular role.
    2. restrict modify access to be limited to the queries created by the user.
    Much appreciate any suggestions/ideas/thoughts.
    N

    Hi naveen!
            I think you can do this by seting the  Authorization object of the report owner to the follwing my give you this result RSZOWNER = "$USER" allows the user access to activities in all the components he is an owner of.
    you can have more help in help.sap.com in underthe follwing  structure
          BW 3.1 content
                      -> systemadministration tasks-> authorizations-> authorizations for working with business explorer-> and examples for reporting authorizations
    Message was edited by: ashwin gadi

  • Question S_QUERY and HR-AdHoc-Queries

    Hello,
    I've posted the following in the SAP-Solutions -> SAP-HCM forum, but got no answer yet; maybe this issue is more security related:
    We are planning to give our users access to transaction S_PH0_48000510 so they can execute queries on their own.
    The according InfoSets and UserGroups have been created and so far out tests work fine.
    What we are now aiming to, is to give our users not only execution-rights, but allow them to create/save/modify "personal" queries.
    (that is, the rights depend on the username)
    My understanding of security-object S_QUERY is, that it gives access to all queries in a given InfoSet, and that is not desirable.
    Any hints how make "personal" queries work ?
    cheers Axel

    Well, thank you in the first place for your answer, but I think I need some further clarification. Below is the SAP-Help-text from this little checkbox in SQ03:
    <quote>
    SAP Query: Authorizations
    Only the users for whom this field has been selected are authorized to change or create queries.
    Authorization object S_QUERY controls authorization to change or create queries (value 02 in field 'ACTVT').
    This check box allows you to revoke special user group authorization for users who have authorization according to authorization object S_QUERY.
    Use
    Revokes authorization to change or create queries for a specific user.
    </quote>
    So I think this checkbox is intended for revoking rights already given via S_QUERY (and not limiting them to ones's own account).

  • Issue with Adhoc queries

    Hi,
    Background: 3 additional fields were added to infotype 0023 to capture the position at the previous organization, Years of exp and Months of previous exp.
    The year and Month of previous exp gets populated automatically if you save the start date and end date.
    Issue: We try to populate a repot using adhoc query but it doesnot give proper data. example if 0023 has been updated for 100 employees the output would reflect only for 20 odd numbers.
    There is no authorization problem
    Can anyone suggest why we are facing this issue and if this can be resolved also is there any standard SAP reprot which can give a listing of 0023 for a list of employees
    RB

    Also, if the dates of IT23 are before hire date (as they often are), you need to set the switch for time-dependency.  You do this in "extras" -> "Code".  The syntax is shown below, and the *$ is part of the syntax
    *$HR$ [P0022,P0023]
    *$HR$ TIME_DEPENDENCE = 'INDEPENDENT'
    You still need to ask for period all, but then it should work.
    Hope this helps.
    Kirsten

  • Caching of adhoc queries=filesystem sometimes at 100%

    WLS_PRODUCT_VERSION=10.3.6.0
    OS: Red Hat Linux 5
    DB: 11.2.0.2.0
    OBIEE: 11.1.1.6.2
    Hello.
    When someone runs a silly query via OBIEE we sometimes see .TMP files that have ranged in silly sizes (up to 25GB!)
    We have been caught by this as the growth is too fast for Grid monitoring to alert us on. When the filesystem hits 100% Linux wont let me remove any of those .tmp files and its all very embarrassing . . .
    Is there some way that any of the front end interfaces (OEM/ WebLogic Server) can alert us to these crazy tmp files being generated?
    It would be nice to be able to nip these in the bud before we gets egg on our faces.
    Thanks

    Hi Magnus,
    Can anybody see some windows of vulnerability here? Is it for instance possible that the cache lock held by the XA-transaction is released before the database update has completed (that way a query could be performed against old data and be stored in the cache after the invalidation were performed) or is this just the kind of problems that the XA-protocol is designed to prevent?If the query is performed as you've described and your application can hold the same query key lock before updating the data and only release the lock after the transaction completes, you can be assured that a query based on stale data will not be cached after the transaction. If you want to be assured that no stale query results will be returned, remove the cached result outside the transaction just before committing the transaction.
    An alternative I have been considering for how to perform the database query / caching of the result would be to let a cache store class (for the query result cache) perform the queries when no entry exists in the cache but I am not sure how I would change the locking protocol to make it work - can I even lock a cache entry from this kind or component or would that cause a deadlock?I think you can implement a CacheStore class for the query result cache that can be used to provide the appropriate locking. If implemented correctly, I don't think there is a risk of deadlock.
    Regards,
    Harv

  • Adhoc Query Join Problem

    Hi All,
    I have created a query on PNP logical database which looks very simple, Lets say it has pernr, first name, last name, and Mailing ZIP on the output. P0006-SUBTY = 'MAIL'
    Now, the problem is .... if someone do not have mailing address subtype populated then that pernr's record is not appearing on the output. ZIP should be blank if the Mailing Address subtype is not saved for that pernr.
    I am using PNP in my infoset so I think I do not have any control over the joins, PNP should not behave like this I guess, is it normal behavior or it can be fixed? or this is one of the reasons to go for Custom ABAP Reports as it cannot be done in SQ01?
    Is the only solution through Adhoc queries to add all these PA tables in Inner Joins instead of using PNP, in SQ02?
    Thanks in advance.

    It is a common behavior of Adhoc query in PNP. You will need to create custom fields and put logic for subtypes. Using joins is not a good solution, for performance issues you cannot join many tables and HR tables have begda and endda in tables which may create problems for proper joins.

  • 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.
    Thanks

    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.

  • What is adhoc query?

    hi,
    sap gurus,
    good afternoon toall,
    what is adhoc queries ?
      how it is related toreports
    is there any tcode for adhoc query creation
    regards,
    balaji.t
    09990019711

    Hi:
    Refer to the following websites for adhoc query
    http://www.insightcp.com/res_15.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/15/00a042b443c56ae10000000a155106/content.htm
    Information Systems - Ad Hoc Reports -SQ01 - SAP Query
    Please let me know if you need more information.
    Assign points if useful.
    Regards
    Sridhar M

  • How to track changes in Adhoc query?

    Hi all,
    We have requirement for retrofitting  the changes done in one Server to other, in the process the Changes in New server should not be overwritten.Currently for Adhoc queries - we're downloading from one server-  loading to the New server.
    Is there any way to track the changes in Adhoc query to avoid overwriting the changes.
    Thanks  in advance.
    Harika.

    Hi,
    You can download the Employee wise Bank Details of IT0009 or using Adhoc query
    You have employee wise WT reporter
    Now do a Vlookup with the Employee Wt report  and the Adhoc query.
    If you have problems in vlookup
    pls send both the files to me on hemant.mahale capgemini com
    Regards
    Hemant V. Mahale

  • Adhoc Query

    Hi,
    I am using PAAH to execute Adhoc Queries.
    After executing T. Code PAAHEdit SettingsStatistics
    I clicked on Output Icon for executing Query relating to IT 0041. I am seeing a column called as Number where  it shows the number of records per Infotype.
    My Question is that the Number Column is showing 12 if I maintain all the fields in IT 0041. Is it possible for number column to show 1 instead of 12 thus showing the number based on records not on fields. It is working fine for other infotypes but not for IT 0041.
    Please Help.
    Regards,
    Ghanapriya

    Hi,
    It is standard logic enforced by SAP. You can change it to your own logic by changing respective infoset. To do that you should follow these steps:
    1. In transaction SQ02 select your infoset > CHANGE
    2. Go to "Field groups/data fields" section (right top corner) and find field group "Date specification". Remove from there standard SAP fields P0041-DAR01 and P0041-DAT01. These are the fields that loop during selection.
    3. Now you should add fields with your logic. For that go to "Data fields" section (left side of the screen). Find infotype "Date specifications P0041". There you should add new table to selection - PA0041. To this right click on line "Additional fields" > Create > Additional table > PA0041 and add selection criteria:
    SELECT SINGLE * FROM PA0041
    WHERE PERNR                = P0041-PERNR
       AND SUBTY                = P0041-SUBTY
       AND OBJPS                = P0041-OBJPS
       AND SPRPS                = P0041-SPRPS
       AND ENDDA                = P0041-ENDDA
       AND BEGDA                = P0041-BEGDA
       AND SEQNR                = P0041-SEQNR
    Save.
    4. Finally you have to add new fields to your infoset. Select from newly added group "HR Master Record: Infotype 0041 (Date Specifications) PA0041 " fields from "Date type PA0041-DAR01" to "Date for date type PA0041-DAT12" (all of date types) and drag and drop them to field group (see step 2) "Date specification". Save and generate your infoset.
    Now you will see all date types in one line in report output.
    Cheers

  • Adhoc Query : Auth

    Hi All,
    I want to restrict a User for a custom craeted Adhoc Query created.
    In, T.Code : S_PH0_48000510 - Personnel Management -> Administration -> Info System -> Ad Hoc Query
    User Group : ZHRPAYROLL
    Infoset : ZHRPAY
    Query : EmpMaster
    How do give auth for a user for this particular Adhoc QUery - EmpMaster
    Thru which auth object this can be achieved?
    T&R

    Hi Rama
           Adhoc Queries  - S_PH0_48000510 and S_PH0_48000513 are the standard defined by SAP and you can create a Custom Infoset with T.Code SQ02 and custom User Group with SQ03. you can do it either in Query Area Standard or Global as per your requirement.
    In SQ03 you will link the Infoset and there you can define the User by whom that can only be accessed.
    Where as if u wish that A User should have access to only one Query then create a Query with T.code SQVI by logging into that User's ID (So that only that User can access that Query). While creating you can use the data sources either Table or Table Join or Logical Database (PNPCE) as per your convenience.
    Then the autorisatoin to T.Code S_PH0_48000510 to that particular User is not required.
    First Try in your Quality Client and test and once successful do it in your PRD
    Hope this will Help you
    Regards
    Srikanth

Maybe you are looking for

  • A PDF function not working correctly in Pro and Reader

    Here is more information from the field staff who informed me of the issue: As far as adding pictures to Live Cycle form. When field personnel entering the inspection data into the form, if it opens in Reader, they cannot add a photo by clicking on t

  • Can I move a subpage to the root page location?

    The default homepage of our exisiting portal users is the page group root page. We have designed a new page that we wish to use as the root page. This new page is current a subpage within the page group. How can I copy or move this subpage page so it

  • Mobile Me or On my Mac

    Hi, I have a Mobile Me subscription and I'm wondering if I should be creating my iCal's on Mobile Me or 'On My Mac'? Surely those on my Mac just sync to Mobile Me so I'm a bit confused as to why iCal offers me both options. Please could someone advis

  • ITunes 9 on 10.6 won't launch not properly localized for this language

    I have run the iTunes 9 installer on Snow Leopard in the UK. It appeared to complete the install successfully. When I open the app it fails to launch with an error - That this version of iTunes is not properly localised for this language - please ins

  • Can I use the unlocked Iphone 6 in germany (with german card)?

    I am only for 1 year in the us and I want to buy a new iphone but I am not sure if it would work in germany. i don't really know much about technics but I heard that you use gsm in europe ... can anyone help me ?