Building ABAP Queries

Hello Gurus
Does any one of you have any information regarding building ABAP queries in SAP? Any documentation will really help.
Please let me know And/OR Email the relevant documentation to
[email protected]
Regards
Siddharth Sridhar
SAP SD Consultant

Hi,first setp for ABAP Query is Create a User group-SQ03
then second step is create infoset-SQ02
then here select direct read from the table ex then select include all table fields.then click on join tab in the nxt screen
then click on insert table then here enter vbap.
then select fields what ever u want from that tables.
then goto SQ01 and execute this query.
save it in local object.
reward points if it helps
thanks&regards
veera.

Similar Messages

  • How to check syntax errors in ABAP Queries

    HI Guys,
    How to check syntax errors in ABAP queries, Can please provide the T-Codes.
    Advande thanks to everybody.
    Thanks,
    Gourisankar

    Hi
    with these you can check syntax errors and performance points
    Hi
    these all are doing t he same thing that is checking the program for better performance
    Tools for Performance Analysis
    Run time analysis transaction SE30
    SQL Trace transaction ST05
    Extended Program Check (SLIN)
    Code Inspector ( SCI)
    Run time analysis transaction SE30 :This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
    SQL Trace transaction ST05: The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
    The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
    The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
    To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
    Extended Program Check
    This can be called in through transaction SE38 or through transaction SLIN. This indicates possible problems that may cause performance problems.
    Code Inspector (SCI)
    You can call the Code Inspector from the ABAP Editor (SE38), the Function Builder (SE37), the Class Builder (SE24), or as a separate transaction (SCI).
    The Code Inspector indicates possible problems. However, note that, especially with performance issues: There is no rule without exception. If a program passes an inspection, it does not necessarily mean that this program will have no performance problems.
    reward if usefull

  • How to find out which abap queries were executed by a user

    Dear SAP Gurus,
    Is there a way to find out which abap queries were executed by an end user in the recent past??
    1.I tried using the t-code "stat" BUT:
    dont seem to be getting any results even though I put the start time almost 2 months back.
    2.Also when using STAT, I give the report name of the query in the program field but it seems to truncate it.
    Any ideas how can I find out which abap queries were executed by the end user.
    thanks a lot, I'll make sure to award points for your help.

    STAT will give you the information for a limited period of time and is limited to the server which you are logged onto yourself. Beyond 24 hours it is of even less use even if you change the selection screen values.
    If you want it for a period way back into the past, then you need to use ST03N.
    There are at least 2 dependencies and 1 confusion:
    1 dependency) The length of period is determined by the size (length) of the file. You can change this in ST03N (default 50MB) via the menu settings.
    2 dependency) The stat collector jobs need to be scheduled to write the information to ST03N (once per hour is a legal requirement in some non-banana republic countries).
    1 confusion) There is an obscure function which converts a report submit to a transaction name (there is not much difference anyway) and an even more obsure one which filters what ST03N will record and therefore whether you can read it. You can (un)filter these things away if you search the SAP Marketplace for the term "MONI".
    What is of particular value from this control is that you can even detect a submission of an abap which only existed temporarily.
    Also note that having this information is potentially very powerfull with respect to the users (some of them are human too), so you should expose and use it responsibly.
    You should also ensure that only responsible users / auditors have access to S_TOOLS_EX.

  • Executing Abap Queries in Abap Code and processing the result

    Hi,
    I want to execute ABAP Queries (designed by sq01) in an abap report and processing the result in an internal table.
    How could it be work?
    Thanks a lot for your responses,
    with kind Regards
    Reinhold Strobl

    Hello,
    GO to SQ01 and select your query. Go to Menu QUERY-->More Functions->Display Report Name.
    You can then take that report name and go to SE38. Copy the code before END-OF_SELECTION and then modify as per your own requirements.
    Regrads
    Saket Sharma

  • ABAP Queries  not available after upgarde from 4.6C to  ECC 6.0

    Hi All,
    We have upgraded from 4.6C to ECC 6.0 version. There is some problem with the ABAP queries. The ABAP queries created in 4.6C were assigned to a Ztcode and now after the upgrade when we execute the Ztcode we are getting the error
    that the program does not exist.
    I tried to regenerate the code ( a new program name is generated) but there are differences in the selection screen (like the output format etc) between the two versions.
    I looked into the relevant SAP notes also but could not find any solution.
    Could any of you suggest any ideas to generate abap queries after upgrade?

    hi,
    Re: SAP version differences 4.5b, 4.6c and ECC6.0
    http://help.sap.com/saphelp_47x200/helpdata/en/fc/e3003deddfae4de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_scm50/helpdata/en/28/b34c40cc538437e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/43/68805bb88f297ee10000000a422035/frameset.htm
    Hope this helps.
    venkat.

  • ABAP Queries

    We have just upgraded from 4.6 to 6.0. I have noticed lot of differences in the code behind the ABAP queries that is generated once the queries are created. In some instances they are form bunch of include programs like the ones below but in some other queries its the regular code of a query program like it used to be in 4.6 . I also noticed that the extra coding I did in the END_OF_SELECTION event of the Infoset is not getting picked when I execute the query. Have any of you encountered these things?
    *report AQICZSD_CORP====Z_DIR_SALE_NEW.*
    *include /1BCDWB/IQ000000000725DAT.*
    *data %dtab type standard table of /1BCDWB/IQ000000000725 with header line.*
    *data %subrc type sy-subrc.*
    *include /1BCDWB/IQ000000000725SSCR.*
    *include /1BCDWB/IQ000000000725SSCRAT.*
    *start-of-selection.*
      *if %runmode-extr_on <> space.*
        *call function '/1BCDWB/IQ000000000725EXTR'*
             *tables     %selopt = %seloptions*
                        *%dtab   = %dtab*
             *changing   %rtmode = %runmode*
             *exceptions no_data = 1*
                        *others  = 2.*
        *%subrc = sy-subrc.*
        *call function 'RSAQRT_CHECK_EXTR'*
             *exporting extr_subrc = %subrc*
             *tables    dtab   = %dtab*
             *changing  rtmode = %runmode.*
      *endif.*
    *end-of-selection.*
      *if %runmode-show_on <> space.*
        *call function '/1BCDWB/IQ000000000725SHOW'*
             *tables   %dtab   = %dtab*
             *changing %rtmode = %runmode.*
      *endif.*
       special code for old API and BW extractor calls**
    *form %set_data changing p_lines type i.*
      *import ldata to %dtab from memory id 'AQLISTDATA'.*
      *describe table %dtab lines p_lines.*
      *free memory id 'AQLISTDATA'.*
    *endform.*
    *form %get_data tables p_dtab  structure %dtab*
                   *using  p_first type i*
                          *p_last  type i.*
      *append lines of %dtab from p_first to p_last to p_dtab.*
    *endform.*
    *form %get_ref_to_table using p_lid   type aql_lid*
                                 *p_ref   type ref to data*
                                 *p_subrc type i.*
      *if p_lid = %iqid-lid.*
        *create data p_ref like %dtab[].*
        *p_subrc = 0.*
      *else.*
        *p_subrc = 4.*
      *endif.*
    *endform.*

    Hi Jak,
    I guess all ur questions are answered except 2.
    Ans2. Well a correction is a change done to a original SAP object, while a repair is done to a duplicate SAP objects. (I hope its not vice vers, I am bit confused wid that : ) )
    Lets take an example. All the object on a customer system are duplicate object since they are all copy of Original SAP object. So if u make a modification to an existing SAP object at a customer system it comes under the category of Repair i.e all customer modifications of SAP standard objects are repairs.
    While if SAP makes changes to its original object it comes under Corrections. i.e all support packages / Notes comes wid correction requests.
    Now what if a customer has its own object changed .. .then it wil come under the cateogry of correction and not repair.
    Now the trick is which system Dev , Test , Prod ...
    well ofcourse Development .. since your test and production system contains a copy of the objects in Development system.  : )
    hope this help .... but please verify the answer I may not be 100 percent correct.
    regards,
    Sumeet Mishra

  • Creating ABAP queries with t-code SQ01 in SRM

    Hi.
    What tables are available for me to use ABAP queries with t-code in SRM as we currently use this for MM.
    Please can someone tell me if a list of usefull tables for Carts, Approvals, PO are available in SRM as I cannot find these in SE11. We have no BW and need ABAP query for fullfilings any business requirements.
    Thankyou.
    Vijay.

    Please search the documents in transaction BBP_PD. When you click the details it will give you the table details as well.
    Additionally check this thread for details
    good source for tables and reports
    Regards
    Kathirvel

  • How to put Mandatory option for selection screen fields in ABAP Queries

    Hi Experts
    Can anyone tell me how to put mandatory option for the selection screen fields in ABAP Queries.
    Manually I had written code in the At Selection Screen  option in infoset to display error message if that field is blank.
    But I need to display the selection fields with the tick mark (obligatory mark).
    How to do this?
    Appropriate answers will be awarded

    Hi
    For parameter option
    parameters : p_kunnr type kna1-kunnr  obligatory.
    For select option
    select-options: s_date for vbak-erdat obligatory.
    Plz rewards points ,
    Regards ,
    Ganesh.

  • Tool for building LDAP queries

    are there any visual or non visual tools for building LDAP queries ??
    thanks and regards
    Renjith.

    I've had great success with JDeploy - you can download it here:
    http://www.tiobe.com/jdeploy.htm
    IF not, you might want to check out the resource listing at google:
    http://directory.google.com/Top/Computers/Programming/Languages/Java/Development_Tools/Deployment/?il=1
    Best regards,
    Bj�rn B�rresen

  • Top Of Page in ABAP Queries

    Hello everyone,
        I want to write some text in theTop-of-page event of Queries.
        I am trying to print the text by using a write statement.But I am not succesful.
        Let me know how to use top-of-page in ABAP Queries.
       Regards,
       Najam

    Hi,
    you need to write the desired code in the top of page event....
    here is the piece of code ..just go through this... and call top of page before start of selection.
    TOP OF PAGE
    TOP-OF-PAGE .
    To Write the header of the Report
      PERFORM write_header .
    *&      Form  WRITE_HEADER
          text :Subroutine to write header
    FORM write_header .
      DATA: v_date(10),
            v_start(10),
            v_end(10) .
      WRITE : sy-datum  TO v_date  MM/DD/YYYY,
              p_prcdte  TO v_start MM/DD/YYYY.
      WRITE   5 '|'  .  ULINE AT 5(95)  .  WRITE 100 '|'    .
      WRITE /30  text-028 INVERSE COLOR 7  .  WRITE 100'|'  .
      WRITE   5 '|'  .  ULINE AT /5(95)  .  WRITE 100 '|'   .
      WRITE:  /7 'Date/Time        :', v_date, ' / ' , sy-uzeit   .WRITE 100 '|'  .
      WRITE   5 '|'  .  ULINE AT /5(95) .WRITE 100 '|'  .
      WRITE: /7 'Processing Month :', v_start   .  WRITE 100 '|'  .
      WRITE   5 '|'  .  ULINE AT /5(95).WRITE 100 '|'   .
      SKIP 2 .
    ENDFORM.                    " WRITE_HEADER
    if u wanna to do for alv then the piece of code provided by Nick will be helpful..
    Thanks & Regards

  • Download & Upload of SAP ABAP Queries.

    Hi All,
    Can anybody please guide How to Download & Upload SAP ABAP Queries.
    Waiting for positive reply.
    Thanks in advance for help.
    Regards,
    MAM

    Program RSAQR3TR is the standard program.
    You can simply download your infoset/query from your source system and upload the  file into your destination system.
    It should works.
    If, for some reason you are not authorized to upload/download, you can create a transport and import it using the usual way.
    Best regards.

  • BDC, SCATT, SECATT & ABAP Queries

    Dear All,
    Can someone please help me out with the following?
    1. What is "System Design?" 
    2. Meaning of BDC, SCATT, SECATT & ABAP Queries & Detailed steps in BDC, SCATT, SECATT & ABAP Queries?
    3. Difference between Report Painter & Report Writer?
    4. What is Cutover Date & Cutover Activities?
    Thanks in advance     
    Regards,
    Varma.

    Moderator message - this is wrong on so many levels, I don't know where to begin, Maybe someone can help me.
    Rob

  • ABAP Queries table

    Hi,
    can any bady help me that there is a one table which stores all custom abap queries , i need that table urgently

    Hi,
    in table AQGDB table there is 5 fields , in which filed i have give qurey name to search is there or not

  • In which Table all ABAP queries store?

    Hi Guys,
    In which Table all ABAP queries store?
    Thanks,
    Sa nkar

    Hi..
    ABAP Queries are also stored in the Table TADIR along with other Repository Objects.
    the following fields must be checked to Find ABAP Queries in this Table:
    PGMID = 'R3TR'
    OBJECT = 'AQQU' "For ABAP Queries
    This will help u to retrieve the ABAP queries from this table TADIR.
    sample code:
    data: itab type table of TADIR.
    SELECT * FROM TADIR into table ITAB.
    WHERE PGMID = 'R3TR'
    and OBJECT = 'AQQU'
    and (OBJ_NAME like 'Z%' or OBJ_NAME like 'Y%').
    REWARD IF HELPFUL.

  • Re: join cluster table into transperant table in ABAP Queries

    Hi gurus
    How to join cluster tables into transperant tables in ABAP Queries,
    I want to join KNA1, KNB2, BSEG(cluster table)
    pls explain me
    amk

    Hi
    You can use join for KNA1 and KNB1 which will much faster
    then use for all entries of this itab to get the BSEG to improve the performance
    here you need to do some trial and error method by joining  removing the tables and also for all entries
    regards
    Shiva

Maybe you are looking for