SAP Query creation procedure

Hi,
Can any one send me complete procedure for creation of query in SQ03. Please give me step by step procedure
Thanks,
Regards,
Mukul

hi,
in sq02 define the infoset. here u define the tables and the join relation between them. generate the infoset. in sq03 create user grps (if not already existing) and then assign the infosets to them. assign user ids to the the user grps.   in sq01 create the query in the infoset and define the list and selection fields. make sure u check the query area in which the infodset and the query is created (global or client sprcific).
saurabh

Similar Messages

  • Could anyone provide the complete manual of SAP Query Creation

    Hi,
    Now I am learning to create SAP Query.
    I viewed many questions and answers about SAP Query.
    Some mentioned this,and some did that...
    Could anyone provide a complete manual of SAP Query Creation for developers.
    I can create SAP Queries step by step with it.

    http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Step-by-step guide for creating ABAP query
    http://www.sappoint.com/abap/ab4query.pdf
    ABAP query is mostly used by functional consultants.
    SAP Query
    Purpose
    The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
    Features
    SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
    All the data required by users for their lists can be selected from any SAP table created by the customer.
    To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
    ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
    To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly
    use either SQ02 ans SQ01
    or SQVI tr code
    for more information please go thru this url:
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://goldenink.com/abap/sap_query.html
    Please check this PDF document (starting page 352) perhaps it will help u.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    check the below link will be helpful for u
    Tutorial on SQVI
    once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same
    useful
    http://www.erpgenie.com/abap/code/abap47.htm
    regards,
    Prabhu
    reward if it is helpful

  • SAP Query Creation

    Hi All,
    I am creating a SAP query in the system using the tables KONP,MBEW & A018 i could join tables KONP & MBEW but i am not able to add the table A018 and a error message is displayed
    Error Message:
    Table A018 cannot be used in a join
    Message no. AQ501
    Diagnosis
    1. You cannot read the selected table with SELECT statements (because, for example, it is a structure without a database table). Therefore, this table cannot be read within a table join either.
    2. The chosen table is a pool or cluster table. These tables may not be used in a table join.
    Can anyone tell me a alternative to join this table to MBEW & KONP.
    I want this Join Conditions:
    MBEW-MATNR = A018-MATNR
    A018-KAPPL = KONP-KAPPL     
    A018-KSCHL = KONP-KSCHL     
    A018-KNUMH = KONP-KNUMH
    Thanks & Regards
    Andrew
    Edited by: Andrew J on Dec 18, 2008 2:49 PM

    hi,
    use  FOR ALL ENTRIES
    EXAMPLE:
    Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement.
    PARAMETERS p_city TYPE spfli-cityfrom.
    TYPES: BEGIN OF entry_tab_type,
             carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
           END OF entry_tab_type.
    DATA: entry_tab   TYPE TABLE OF entry_tab_type,
          sflight_tab TYPE SORTED TABLE OF sflight
                           WITH UNIQUE KEY carrid connid fldate.
    SELECT carrid connid
           FROM spfli
           INTO CORRESPONDING FIELDS OF TABLE entry_tab
           WHERE cityfrom = p_city.
    SELECT carrid connid fldate
           FROM sflight
           INTO CORRESPONDING FIELDS OF TABLE sflight_tab
           FOR ALL ENTRIES IN entry_tab
           WHERE carrid = entry_tab-carrid AND
                 connid = entry_tab-connid.
    REGARDS
    RAHUL

  • SAP Query Creation - Where to do? Dev or Prd

    HI,
    We have a two system landscape as DEV and PRD.
    We want some query to be generated in PRD. So whether we have to create in DEV and then transport the report to PRD or Can i directly create query in PRD and then assign one transaction code for that?
    Is there any drawback in creating Queries in PRD directly?
    Please give a idea about queries.
    Regards,
    Lijo Joseph
    Message was edited by: Linda Bortolus (just to mark the post as a question)

    Hi Lijo,
    That is precisely what I had in mind when I said that <i>"....the SAP Query, in general, is only used to SELECT the data..."</i> !!
    Though the purpose of the coding section is only to enhance / customize the display, there's nothing to prevent a DELETE / MODIFY statement in there.
    If you think that there is a chance that someone might access the query in the production system in change mode, then you have a major risk. But I think it is not a problem to prevent access to SQ02 in the production system. But then, the developer who writes the query (I guess that's you in this case ) should also exercise extreme caution in handling this part. NEVER use any DML statements here (DELETE / MODIFY / UPDATE).
    Hope this information has been useful.
    Regards,
    Anand Mandalika.

  • SAP Query transport

    Hi,
    Wish to have step by step procedure of transporting SAP Query ?
    Procedure I followed & got error message
    I have used SQ02 & truck symbol it is creating only one TR without any customising task.
    Using T.code SCC1 in the target system I got error message
    " Program ended with error or warning, return code: 4".
    Can someone help?
    Regards,
    Vengat

    Hi
    Here I am sending the step by step procedure for the SAP Query. Hope this helps you, if so please issue points.
    1. Go to SQ02 .
    Select Environment -> Query Areas
    Select Standard Area (Client specific) as show below
    2. Select Environment -> Transports
    Select Import radio button
    Check Overwriting allowed (only with import/upload/copy)
    Remove Check for Test Run
    Select Transport InfoSets and queries radio button
    Fill Infoset and Query with corresponding names
    Fill Import option with transport request number.
    3.  Click on Execute button
    With this it will be done.
    Thanks for your patience

  • Issue in transaction code creation for sap query report .

    Hi  Gurus,
    I have a requirement to create transaction codes for sap query reports. I found two ways to create transaction code for sap query report
    1) By Generating program for sap query report and creation of transaction code for that generated Program. in tcode.
    2) By using parameter transaction options in start object of se93
    What are the difference between creation of these two ways. Please specify  the advantages and disadvantages of both methods.
    Regards,
    Suneel Kumar Uggina.

    Hi Jogeswara Rao,
    But I am getting problem while transporting form development system to  the production system. After transporting to Production system  I have used the code created in development system, but it is giving Error ' No Program Found for that Transaction Code. And  I would like to know  on what conditions should I have to  use the First one  and as well as a second one in sap query reports.
    Thank You,
    Suneel Kumar Uggina.

  • Creation of SAP Query in SQ02 with Single Table With Condition

    Hi All,
    I want to Create SAP Query in SQ02 using single Table MCHA.
    ii) I dont want all entries of MCHA Table I mean , I have to apply some Condition on this Table.
    i.e  Suppose I am having actual data in MCHA table is like this for Material M1.
    Plant    Material   Batch   BatchCreationdate
    P1          M1         B1       20.06.2007
    P2          M1         B1       04.05.2009
    P3          M1         B1       04.05.2009
    But I want the Output of SAP Query is like this:
       Material   Batch   BatchCreationdate
          M1         B1       20.06.2007
    That is irrespective of Plant if Material & Batch are equal ---> 1st record with Lowest date shoud get at the output.
    Please help me How write the code on single table in the SAP Query.
    Thanks,
    Kiran Manyam

    Hi,
    Your query should be like this:
    Select MATNR CHARG HSDAT
    from MCHA
    into table t_mcha
    where matnr = Materlal number from selection screen.
    The structure of t_mcha should contain the fields that you select.
    Then sort the table by date ascending
    Sort t_mcha by HSDAT.
    Hope this solves your problem.
    Thanks,
    Sowmya

  • Question on creation of t-code for SAP query

    Hello,
    I posted a thread in here back on 06/20/2007 asking for help on creating a t-code for a SAP query. one of the responses that I recieved was
    <i>"Sure, all you need to do is get the report name which is generated by the query. You can find this in SQ01, select the query and from the menu, Query, More Functions, Display Report name. Then go to Se93 and create the tcode with this report name."</i>
    the report name was AQFKZFINANCE====GL_FRANCE=====.
    I created the t-code using this name. I had it transported to my QAS system an now we are getting a error stating that the the program is not found.
    When I check in SE38, I can see this program AQA0ZFINANCE====BP_RECON====== in both my development system and my QAS system.
    Should I have created in the t-code using the AQA0ZFINANCE====BP_RECON====== instead of the AQFKZFINANCE====GL_FRANCE===== program? 
    Is there any reason why the program AQFKZFINANCE====GL_FRANCE===== would not be in QAS?
    I do not have access to SQ01 in our QAS system so I cannot perfrom the process stated above.
    thanks in advance for the help.

    Hi,
    Please check this thread perhaps it may help.
    Re: How to create TCode for Sapquery
    Regards,
    Ferry Lianto

  • SAP Query-for  Reporting   how to create and use it

    Hi SAP Gurus,
    i need your help. in my project, client is asking to create queries to generate reports, i am not familiar with queries, so would appreciate it if any one can guide me and tell me the procedure for writing and creating queries soon.
    also if you have any study material on steps on How to write and create queries for PP module
    thank you very much

    Hi
    Please refer below document
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Also refer below
    How to Create Infoset Query (SAP Query)
    Steps on how to proceed to create a Query:
    ADHOC QUERY
    A query can be created to extract information from master records  i.e  Infotypes.  For example, by creating a query , the data relating to an employee contained in various Infotypes can be extracted.
    Proceedure :  
    Decide on  the various Infotypes we  want to make the query.  Decide on the area where we  want to query  i.e  Global area or Standard area.  Standard area is client specific and globel area will include all clients.
    Menu : HR – PM – Admn -  Information System -  Adhoc Query
    Select area standard and select the  user group already created
    Creation of new query  :  
    TC SQ03  -  Select Environment – Select Standard Area -  Enter  --  If new user group is to be created, enter name of the user group, click on create and enter necessary information and  exit after saving
    TC SQ02  -  Enter name of the Infoset – Create – enter name of Infoset -  Data source -- >  Table join by basis table – give name of table e.g  pa0000 -  Enter -  Click on insert table if we  want to include more tables – give name of table one by one and after finishing,  place cursor on the joining lines and right click to delete unwanted relationships  - check  - and go back  - field groups  -  include all table fields  - click on generate button   -  go out
    TC SQ03  -  Select user group  -   eg.  Payroll
    Infoset  - Enter name of newly created Infoset 
    Assign users and Infosets  -  Assign infosets  -  put tick on payroll  - save and go back
    TC  PAAH  -  Expand the nodes and put tick on relevant fields depending upon necessity
    Save the query  by giving the same name as infoset for easyness..
    For executing a query which is already created
    1. Go to SQ01 transaction
    2. Go to Environment menu->query areas->std areas
    3. Then choose the user group where the query is created
    4. It will display all the queries created for the group.choose the query you want to executeand click execute.
    5. will take to the initial screen
    6. Enter the required parameters and execute
    Regards
    Ranga
    Message was edited by:
            Ranganathan Srinivasamurthy

  • Assigning a SAP Query to Transport Request

    Hi Friends
    I have a SAP Query, now I want it to transport to the other system, while saving the query it is not prompting for transport request. Is there any possibility to assign that SAP Query to a transport request, if yes, please let me know the process.
    Regards
    Praveen

    Dear All,
    This regarding creation of SAP Query .
    Situation:
    Infosets and User Groups were created in a DEV SERVER CLIENT 200 and saved in a request ie.REQ01
    Now i wanted to create a Query QU01 in the Same User Group  in DEV SERVER CLIENT 210  so i tried creating a Infoset but i get this error message
    Note: I am not able to create & save an Infoset.
    Message no. TK414
    Diagnosis
    You cannot edit request D01K901880 of user X00012, since this request is reserved for changes in client 200. You are logged on to client 210.
    Can anyone clear this error? what is the solution?
    Thanking You
    Andrew

  • New sap user creation

    Hi All SAP experts,
    My company has implemented 2 Systems SAP Landscape with one development and one production server which are running on R/3 Enterprise 4.7 (Kernel Release 6.20) with Microsoft SQL 2000 as database server.
    I have the following questions regarding new sap user creation by using user copy function.
    1.When I request to create new SAP User by using user copy function ,should I just create the user acct in DEV and transport it to PROD System? If yes, how could I do that?
    2.When I request to create new SAP User by using user copy function, can I just create it on PROD System only? If yes, what is the impact?
    3.When using User copy function to create new user acct, should I select all parts (like adress ,defaults,reference user, user groups.....) of the existing user to be cloned to new user acct?
    Thanks.
    Leon

    Hi Leon,
    Answer to your questions in their respective order:
    1. You can create user in DEV and then make remote client copy to PRD system using scc9 t-code. Here you can choose user accounts and authorizations for the copy. ( Rem: Data will be overwritten in target system when copied).
    You can also use client export/import(scc8/scc7)
    But, When you do the client import from the exported files using STMS,you will have to select only one of the transport requests and then STMS automatically selects the other requests for you.
    Then it will show you the different transport requests that you have created during your export, the client copy profile and the target system and client. The customizing and application data is deleted in the target client before copying for all profiles except SAP_USER. This is technically unavoidable (and hence the data will be overwritten).
    So if you can afford overwritting of user data in target client , you can go with the above procedure.
    2. Using  user copy in su01, you can copy one user to another user only in that client and is confined to that system only. So yes, If you want 2 or more users to have same authorizations, profiles ,etc etc.. you can choose this in PROD system.
    3. It depends.. If you want user to be in same group, then you can choose user groups. If you want them to have same authorizations , you can choose roles and profiles... If you want them to have same company address and others,... you can select address.. and so on.
    Also below link provides required steps in case you choose local/ remote client copy:
    http://www.sap-basis-abap.com/bc/client-copy-by-using-scc8-and-scc7.htm
    Hope this helps...
    Thanks,
    Ajith
    Edited by: Ajith Kamath on Oct 20, 2009 8:28 AM

  • Help needed on creating a SAP query

    Hi All,
    Can somebody give me the step by step procedures of creating a SAP query and Infoset.
    My requirement is to display asset master details with Asset number or Asset class as input.
    Any pointers or links to create an infoset and query will br highly helpful.
    Thanks,
    Arun

    Here are couple of fields you might be needed :
    AGKO     Cleared Accounts
    ANAR     Asset Types
    ANAT     Asset type text
    ANEK     Document Header Asset Posting
    ANEP     Asset Line Items
    ANEV     Asset downpymt settlement
    ANKT     Asset classes- Description
    ANLA     Asset Master Record Segment
    ANLB     Depreciation terms
    ANLC     Asset Value Fields
    ANLH     Main asset number
    AT02T     Transaction Activity Category- Description
    AT02A     Transaction Code for Menu TIMN
    AT10     Transaction type
    AT10T     Name of Transaction Type
    BKDF     Document Header Supplement for Recurring Entry
    BKORM     Accounting Correspondence Requests
    BKPF     Accounting Document Header
    BLPK     Document log header
    BLPP     Document log item
    BLPR     Document Log Index and Planned Order (Backflush)
    BNKA     Bank master record
    BP000     Business Partner Master (General Data)
    BPBK     Doc.Header Controlling Obj.
    BPEG     Line Item Total Values Controlling Obj.
    BPEJ     Line Item Annual Values Controlling Obj.
    BPEP     Line Item Period Values Controlling Obj.
    BPGE     Totals Record for Total Value Controlling obj.
    BPJA     Totals Record for Annual Total Controlling Obj.
    BSAD     Accounting- Secondary Index for Customers (Cleared Items)
    BSAK     Accounting- Secondary Index for Vendors (Cleared Items)
    BSAS     Accounting- Secondary Index for G/L Accounts (Cleared Items)
    BSEC     One-Time Account Data Document Segment
    BSEG     Accounting Document Segment
    BSID     Accounting- Secondary Index for Customers
    BSIK     Accounting- Secondary Index for Vendors
    BSIM     Secondary Index, Documents for Material
    BSIS     Accounting- Secondary Index for G/L Accounts
    CEPC     Profit Center Master Data Table
    CEPCT     Texts for Profit Center Master Data
    COBRA     Settlement Rule for Order Settlement
    COBRB     Distribution Rules Settlement Rule Order Settlement
    COKA     CO Object- Control Data for Cost Elements
    COSP     CO Object- Cost Totals for External Postings
    COSS     CO Object- Cost Totals for Internal Postings
    CRCO     Assignment of Work Center to Cost Center
    CSKA     Cost Elements (Data Dependent on Chart of Accounts)
    CSKB     Cost Elements (Data Dependent on Controlling Area)
    CSLA     Activity master
    FEBEP     Electronic Bank Statement Line Items
    FPLA     Billing Plan
    FPLT     Billing Plan- Dates
    GLPCT     EC-PCA- Totals Table
    KNA1     General Data in Customer Master
    KOMK     Pricing Communication Header
    MAHNV     Management Records for the Dunning Program
    REGUT     TemSe - Administration Data
    SKA1     G/L Account Master (Chart of Accounts)
    SKAT     G/L Account Master Record (Chart of Accounts- Description)
    SKB1     G/L account master (company code)
    T003T     Document Type Texts
    T007S     Tax Code Names
    T087J     Text
    TAPRFT     Text tab. for investment profile
    TKA01     Controlling Areas
    TKA09     Basic Settings for Versions
    TKVS     CO Versions
    TZB0T     Flow types text table
    TZPAT     Financial Assets Management product type texts
    VBSEGS     Document Segment for G/L Accounts Document Parking
    VTBFHA     Transaction
    VTBFHAPO     Transaction Flow
    VTBFHAZU     Transaction Activity
    VTBFINKO     Transaction Condition
    VTIDERI     Master Data Listed Options and Futures
    VTIFHA     Underlying transaction
    VTIFHAPO     Underlying transaction flows
    VTIFHAZU     Underlying transaction status table
    VTIOF     Options Additional Data
    VWPANLA     Asset master for securities

  • Sap query report sq01

    Hello all
    I want to create new sap query in sq01 , the requirement is like this eg:- customer a/b/c , I want to generate the  list of last created sales order for the customers a/b/c here I have given 3 customers but I have to execute for 1500 customers
    If customer A creates 3 sales order in that 3 sales orders I want to pick last sales order on 12.09.2010 / 15.09.2010 /17.09.2010 in that I wnat to pick the last sales order 17.09.2010
    So in query report sq01 how to create, plz provide step by step procedure with this logic
    With regards
    Rahul
    Moderator Message: Search.
    Edited by: kishan P on Sep 17, 2010 4:47 PM

    Hi,
      better search in Google with the keyword 'SAP query tutorials',
    you will get lots of tutorials in the net with step by step approach.

  • SAP Query report

    Hi Friends,
    For reporting and documentation reasons I set up SAP Query report which almosts fits our needs.
    Regarding values, what we need is the total value (header or sum of all items) before and after tax.
    I am only able to display the BEFORE TAX VALUE with reference to VBAK-NETWR or VBAP-NETWR.
    is there any possibilty to displays the AFTER TAX VALUE (total value) as well from sales order or invoice?
    Pls keep in mind that I am using SAP query, so i cannot do any coding or calculations.
    Regrards,
    Srikky

    Hello,
      as of my knowledge not. So a different solution could be the following one: in customizing, in "Define and assign pricing procedure", you can assign a subtotal (field T683S-KZWIW) to the price condition item corresponding to the AFTER TAX VALUE. So this value will be stored in the corresponding field of table VBAP (i.e. if you assign subtotal '1' the value of that condition will be stored in field KOMP-KZWI1, and then in the corresponding field of table VBAP-KZWI1).
    I hope this could help.
    Best regards,
    Andrea
    Edited by: abrusa on Sep 13, 2010 2:12 PM

  • SAP Query statements

    Hi guys
    Can any one give me some notes on SAP-Query STATEMENTS.
    I know T.CODES and creation of Info sets, groups etc.
    but  I am finding difficult when i wanted to Join the tables.
    Thanks in Advance.
    Rgds
    BJ

    Hi
    By using T-Code SQVI
    Give query name in QUICK VIEW
    Select the button “Create”
    Select “Table Join” in the field Data source
    Thanks& Regards,
    Subbu.

Maybe you are looking for