How to create Ad Hoc Query

Hi Experts,
Can anyone explain me the configuration steps required to create Ad hoc Query. Please give me the step by step procedure to create Ad hoc Query, since i am new to this assignment.
Regards,
Shadeesh.G
Please type Adhoc Query in search forum you will find lot of threads related to this issue
Edited by: Sikindar on Oct 27, 2010 4:22 PM

Shadeesh,
We were all new at some time or the other.
Please try some well established sources of help such as help.sap.com
A quick hint is to use the transactions SQ03, SQ02 and SQ01. A better way would be to progress a certain distance yourself and then ask for help here when you get stuck.

Similar Messages

  • How to Create a Functiona Query

    Dear all,
    Could any body detail me how to create a functional query. Please give me step by step procedure to create a query.
    I would appreciate if you can give me a material with screen shots. Your help will be highly appreciated.
    Thank you
    Raghu Ram

    Hi Raghu,
               Go through this document it may help you,
    SAP Query
    Step 1: Create User Group – SQ03
    Follow the menu path – SAP Menu > Tools > ABAP Workbench > Utilities > SAP Query > User Groups
    a) In the User Group: Initial Screen -
    Enter User Group Code (self named)
    Click on “Create”
    b) In the User Group (Code): Create or Change pop-up window -
    Enter the User Group Description
    Click on “Save”
    c) In the Create Object Directory Entry pop-up window -
    Ö Click on “Local Object” button
    Ö The User Group Created is saved
    Step 2: Create User Group – SQ02
    Follow the menu path – SAP Menu > Tools > ABAP Workbench > Utilities > SAP Query > Infosets
    a) In the Infoset: Initial screen -
    Ö Enter Infoset Code (self named)
    Ö Click on “Create” button
    b) In the Infoset: Title & Database Screen -
    Ö Enter Description of Infoset in the “Name” field
    Ö In the Data Source selection: Select appropriate Data Source by clicking
    the radio button
    · Source the data can either be multiple tables OR single table. There are 4
    options for the user to select from
    Ö Click on “Continue” (Enter)
    Ö Selected Table gets displayed in the Infoset : Initial Screen
    c) In the Infoset: Initial Screen -
    Ö Click on “Insert Table” button
    d) In the Add Table Screen -
    Ö Enter the Table Name that is to be inserted
    Ö Click “Continue” (Enter)
    e) In the Infoset: Initial Screen -
    Ö Click on “Back” button
    f) In the Field Group Defaults pop-up Screen -
    Ö Select Appropriate Field Group Option by clicking on the radio button
    · there are 3 options to select from. User can select Empty Field Group
    option and then select the data fields in the steps explained further.
    Alternatively, User can select an option which clubs all the data fields
    From all the tables selected
    Ö Click “Continue” (Enter)
    g) In the Change Infoset Screen -
    · the left side lists the Tables that the user has selected in step b, c & d
    · In the right side, system creates field groups, one for each table listed in the
    left part. Initially, the Field Groups are empty
    Ö In the Left Side, Click on the arror next to the table name and expand and
    display all the data fields in the table
    Ö Select a Data Field from the expanded Table view, which is to be added to
    the Field Group on the right.
    Ö Select a Field Group on the right side, in which Data Field selected above
    has to be added
    Ö Right click on the Data Field selected and click on “Add Field to Field Group”
    Ö The selected Data Field gets added to the selected Field Group, which is
    indicated by an arrow next to the Field Group.
    Ö Carry out the steps above to add the required Data Fields to the respective
    Field Groups
    Ö After transferring Data Fields to Field Groups click on “Generate” button
    h) In the Create Object Directory Entry Screen -
    Ö Click on “Logical Object” button to generate the infoset
    i) In the Change Infoset Screen -
    Ö Click on the “Back” button
    j) User is taken back to the “Infoset: Initial Screen” which displays the
    created Infoset record.
    Step 3: Assigning User Group to Infoset – SQ03
    Follow the menu path – SAP Menu > Tools > ABAP Workbench > Utilities > SAP Query > User Groups
    a) In the User Groups: Initial screen -
    Ö Enter the User Group for which Infoset is to be assigned
    Ö Click on “Assign Users & Infosets” button
    b) In the User Group: Assign Users Screen -
    Ö Click on “Assign Infosets” button
    c) In the next screen, select the Infoset, which needs to be attached to the
    User Group selected
    d) Click on the “Back” button
    Step 4: Creating Query – SQ00 & SQ01
    Follow the menu path – SAP Menu > Tools > ABAP Workbench > Utilities > SAP Query > Queries
    a) In the “Query from User Group: Initial Screen -
    Ö Click on “Other User Groups” button
    Ö In the pop-up screen, User Groups, select the User Group for which the
    Query has to created. The pop-up screen closes.
    Ö Enter the Query Code in the “Query” field
    Ö Click on “Create” button
    b) A pop-up screen “Restrict Value Range” shows the list of Infosets assigned to
    the User Group
    Ö Select the Infoset for which Query has to be created
    c) In the new screen Create Query: Title, Format -
    Ö Enter the Description of the Query in the “Title” field
    Ö Click on the “Next Screen” button
    d) In the Select Field Group” screen
    Ö Select the Field Groups from which Data Fields have to be selected for the
    Output
    Ö Click on the “Next Screen” button
    e) In the “Select Field” screen -
    Ö Select the Data Fields, which should appear in the output
    Ö Click on the “Next Screen” button
    f) In the Screen “Selection” -
    Ö Select the Data Fields for the selection criteria
    Ö Enter the sequence in which the selected fields would appear in the input
    screen of the query.
    Ö Define if the selection criteria should be Single Value or Multiple Value Range
    by clicking in the appropriate check boxes
    Ö Click on the “Basic List’ button
    g) In the screen “Query Layout Design” -
    Ö Select the Output Fields from the Data Fields section by clicking the
    appropriate check box
    Ö Change the sequence of Data Field columns if required
    Ö Click on the “Test” button to test the query created
    h) On the “Test Query” screen click “Continue”
    i) In the “Query” screen -
    Ö Enter the selection criteria
    Ö Click on “Execute” button
    j) Save the Query created
    Step 5: Running the Query – SQ00
    a) In the Query From User Group: Initial screen –
    b) Click on “Other User Groups” button to select the User Group
    c) In the pop-up screen “User Groups” select the User Group
    d) System lists all the queries created for the User Group
    e) Select the appropriate Query
    f) Click on “Execute” button
    g) User is taken to the Selection screen
    h) Enter the selection criteria and click on “Execute” button
    i) System runs the query and gives the output
    Regards,
    Murali.

  • HOW TO CREAT VARIANT IN QUERY

    Hi,
    its very simple question but i want the procdure for it.
    how to creat variant in query &maintain?don't give URL's i try it already plzzz.any body have the steps regarding this topic..
    plzzzzzzzz urgent ...
    thanks,
    goodyear..

    Hi,
    If you're using the BEx Analyzer, you can create a variant at the variable selection screen. There is a button "save as variant" and you can also maintain existing variants.
    Best regards.
    LauQ

  • How to create Ad hoc Querry.

    Hi All,
    When I am generating Infoset it is displaying log with some errors,How to solve those errors.
    So please anybody can tell me that how to create
    1). User group.
    2). Infoset.
    3). Querry.
    Regards.
    Skanth.

    Use TCode SQVI for ad hoc query, and what you just mentioned is through T Code SQ01, 02 & 03.
    Regards,
    N

  • How to create an ABAP Query with OR logical expression in the select-where

    Hi,
    In trying to create an ABAP query with parameters. So it will select data where fields are equal to the parameters entered. The default logical expression is SELECT.. WHERE... AND.. However I want to have an OR logical expression instead of AND.. how can I attain this??
    Please help me on this.. Points will be rewarded.
    Thanks a lot.
    Regards,
    Question Man

    Hi Bhupal, Shanthi, and Saipriya,
    Thanks for your replies. But that didn't answer my question.
    Bhupal,
    You cannot just replace AND with OR in an ABAP QUERY. ABAP QUERY is a self generated SAP code. You'll just declare the tables, input parameters and output fields to be displayed and it will create a SAP standard code. If you'll try to change the code and replace the AND with OR in the SAP standard code, the system will require you to enter access key/object key for that particular query.
    Shanthi,
    Yes, that is exactly what need to have. I need to retireve DATA whenever one of the conditions was satisfied.
    Saipriya,
    Like what I have said, this is a standard SAP code so we can't do your suggestion.
    I have already tried to insert a code in the ABAP query (there's a part there wherein you can have extra code) but that didn't work. Can anybody help me on this.
    Thanks a lot.
    Points will be rewarded.
    Regards,
    Question Man

  • How to create a dyanamic query in PL/SQL from XML

    Hi Forum,
    I am having an XML file with tags. I am controlling my JSP page layout with these tags and it is working fine. But I need to send the Orange colour nodes to a pl/sql in the JSP page to construct the query as per the XML
    <?xml version="1.0"?>
    <Jobmanage>
    <Customer name="StGeorge">
    <Column>
    <Name>QM_NUMBER</Name>
    <Title>Job Number</Title>
    <Width>10</Width>
    <Font>Arial</Font>
    <Size>10</Size>
    <Align>center</Align>
    <Display>Yes</Display>
    <cloumn1> QM_NUMBER <column1>
    </Column>
    <Column>
    <Name>QM_JOB_STATUS</Name>
    <Title>Job Status</Title>
    <Width>10</Width>
    <Font>Arial</Font>
    <Size>105</Size>
    <Align>center</Align>
    <Display>Yes</Display>
    <column2>QM_JOB_STATUS</column2>
    </Column>
    <Column>
    <Name>QM_USER_STATUS</Name>
    <Title>User Status</Title>
    <Width>10</Width>
    <Font>Arial</Font>
    <Size>10</Size>
    <Align>center</Align>
    <Display>Yes</Display>
    <column3>QM_USER_STATUS</column3>
    </Column>
    </Customer>
    </Jobmanage>
    The select statement I am using n the JSP page is
    SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >= SYSDATE - INTERVAL '6' MONTH))
    Can you give me instructions how to create the above SQL statement dynamically as per the XML file. I want the select statement in a pl/sql
    BEGIN
    SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >= SYSDATE - INTERVAL '6' MONTH))
    END
    So, when ever the columns hirerachy changed in the XML file it should show theat effect in the PL/SQl. Thats hoe I am aiming to develop.
    Thankx for you time.
    Cheers,
    Krishna

    I want the select statement in a pl/sql BEGIN
    SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS
    IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >=
    SYSDATE - INTERVAL '6' MONTH)) ENDThat doesn't make sense. Such a plsql block would not compile. What is your final goal you want to achieve with this?

  • How to create a select query to compare a collection via jpa?

    I'm new to jpa (java persistence) and its query language.
    If I've an entity named "Person" with a collection of Addresses (a one-to-manay relationahip), how do I create a Select query to get a person by using a collection of Addresses as its input parameter?
    Would "SELECT p FROM Person p JOIN p.addresses = :addresses" work?

    Hi,
    You can try the below logic:
    STATISTICS.date_reg} >= '27-may-2011' and { STATISTICS.date_reg} < ' 27-June-2011'
    I guess you are trying to apply this condition.
    Here in selection formula you need not to give select and from.
    Cheers,
    Kiran

  • How to Create Specific SAP Query for Sales BOM

    Dear All Salute !!
    How I can create a SAP Query which provide information from the Sales Order-Line Item, this specific material is having any BOM or not?
    Suppose, user want Input,
    Sales Order No., Product Category, Duration of Sales Order Release.
    want Output,
    Sales Order No., Customer No., Customer Description, Sales Order Line Item, Material No., Material Description, Delivery Date, Quantity, Sales Order release Date
    Users requirement is, List of All Line Items for which BOM is yet to be Uploaded in the System.
    Please provide complete detail with Table & field by using SAP Query.
    Rgds
    Srivastav
    +91-9973504950

    If I am correct, in table KDST, you can see the details of Sales BOM with sale order.  Since right now, I dont have access to SAP, I am unable to confirm this.  You have to consider this table and develop on your own logic with the help of ABAPer.
    thanks
    G. Lakshmipathi

  • How to create Ad-hoc Action in GP and for WD to process the task

    Hi all,
    I have created another Action in the same block with the Action check as "Optional".
    However, it is not enable for selection.
    How to create an Ad-hoc Action which will invoke another Web Dyrpro (which tag as the callable object of that ad-hoc action) to process ?
    (using CE7.1)
    Thank you.

    I have tried this: http://help.sap.com/saphelp_nw70/helpdata/en/a7/435242e55cc553e10000000a1550b0/content.htm
    It cannot work.
    can help?
    thank you.

  • How to create a global query view

    Hi,
    How to save a query view as global,if user A was to create a view 'V1' , user B should be able to see 'V1' in his list of query views.
    Currently i have created views using bex Analyzer and using the save function in the query designer,but these views are local to the user and cannot be opened by other users.
    In 3.5 we had an option to save view as global from Analyzer.We are on SP11
    Thanks in Advance

    Hi Kiran,
    The reason i want to create a global view is to use it as a data provider in a web template, the problem is if i were to create a view the view being local to my id will not be seen by other users,so if the view needs to be edited in the future it would have to be done by me, if it was global any user can modify the view.
    A view saved in bex portfolio is a bookmark and it as saved on the portal and cannot be opened through query designer.Any work arounds??
    Thank You.
    Karthik

  • How to Create PLD for Query Report

    Hi,
    We have designed some queries for daily inward / outward register.
    For taking Print we need to export data to XL and then need to take print.
    Want to set Print layout for Query based report.

    hello
    after execting the query u ca see  save button click on it write query name and query category as general then again click on save button after that just click on open then u select the  query and just click on create report and u can see name of ur query and just click on user report and click ok
    now go to tool .query->select query print layout--ouble click on ur saved query then ur pld will open set it with its propertites and layouts pls close the thread if ur problem is solved
    thank u
    ragards
    jenni

  • How to create a custom query button in Portal?

    Hello,
    I have a requirement.
    In the portal form developed on a table, I have a EmpCD field which is a LOV. when I select a empcd from the LOV, I want to display that empcd details like EmpName, EmpDept, etc. Is is possible to auto-refresh the page with this condition?
    Or, if this can be done with a custom button on the form, that is, if a user select the empcd from the LOV and then press this custom button, then on this, it gets the desired values from the underlying tables and displays them as labels on the portal form page.
    Any help would be desirable. I am trying this for the past so many days but without any luck. I tried searching the Forums as well as Metalink but could not get anything.
    Thanks.
    Saabir.

    Hi John,
    You can add a new button from the "Formatting and Validation " section by clicking on the FORM+ at the top of all the table fields.You can not do your own where clause as the query is made which includes all the columns of the form as shown on the form .
    for your own queries what you van do is that you can leave the field blank if you do not want that field to be added in the where clause.If you want to add the field to the where clause you can use operators (against each field in there text boxes) to make your own where clause.More operators support are supported in the
    latest version.
    Hope this give you some Information regarding your doubt.
    rahul

  • How to create a dynamic query in which I can vary number of parameters

    I am writing a JDBC connector. I want to write a dynamic query in that. The query should be able to proceed variable number of parameters and also in the where clause the and/or/like parameters I want to place dynamically.
    I can't write store procedures as we just have read only access to Database so I want to do it through query only.
    Please help me out in doing that as I am not able to proceed further without it ...

    Hi,
    Have a luk at :placeholder for IN condition in database adapter

  • How to create authorization to access Query Print Layout?

    Hi again..
    i have 10 query print layout, and not every user can view this layout.
    I assume,
    report 1-3 only for user A,
    report 4-7 only for user B, and
    report 8-10 only for user C.
    How to create autorization for Query Print Layout?
    Thankyou for the help

    Dony,
    In order to createthe PL's of customize report (from Query Manager) you will have to go the Tools Tab of the Menu Bar in which you will have to click the Queries tab which will lead to a drop down menu which when clicked will lead to Quaery Print layout. You will have to choose your query based upon whether from the reports tab double click it to open the Query Print Layout Designer.
    Here again in the Menu Bar you will find the under the Tools the first tab is the PLD which when clicked you can do the same process as explined below
    When you go to the document ( Any Document ) in the tool bar you would find the 24th Icon to be the Print Layout Designer Tab when you click this it takes you to the layout designer window.... below there is tab named set as default when you click this the system would ask you 2 choices
    1. Set as default for all users
    2. Set as default for current user
    Which means that you will have to open each and every form?
    for each and every user and set them as default for the user.
    If you feel this answer is helpful then please do remember to reward points
    Regards,
    Nagesh.

  • How to create ageing query?

    Hi Folks,
    Could you give me an idea how to create an AGEING query  by below requirement ?
    Purpose is to calculate the Ageing, which can be defined as the difference between the Document Date and the current date.
    As the current date is not practical (the AR gets updated once a month, and financial ageing reports usually report compared with end-of-the-month), I propose the
    u2018Last working day of previous month.
    When this interval is created per document the total revenue should be divided into columns based on the ageing:
    1-30 days
    31-60 days
    61-90 days
    91-120 days
    121-360 days
    >360 days.
    Reporting Fields  are :
    Rows & Columns
    Company code
    SAP ID
    Customer name
    Country
    City
    Address
    Postal code
    Total AR
    Current
    1-30
    31-60
    61-90
    91-120
    >120
    >360
    Appreciate your response on this.  Thanks  : Surendra

    Hi,
    In this  you follow th ebelow steps easy
    Go To Create CK F menu-----
    Craete  one Formual Variable on Document Date  with replacement path as 0document posted date
    one more variable Formula Variable with customer exit  on cal cal day
    for that getting the current date  write below code
    WHEN 'ZCDATE'.
    CLEAR: L_S_RANGE.
    L_S_RANGE-LOW = SY-DATUM.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPENDL_S_RANGETO E_T_RANGE.
    ENDCASE.
    when you are creating varaible there is tab in that ( last tab) currency/unit  here you should mention date.
    now use these two formula varaibles Current date formula variable- document date formula varaible
    now uare getting the days
    based on your requirement
    use that
    same Ckf
    one ckf cuurent datevariable -posting datevariable  >30( it gives 0-30)
    in next Ckf current adte - posting date >30<60
    like that you can create as you like.
    Thansk & Regarsd,
    sathish

Maybe you are looking for