Creation of ABAP Query- with SQ01.

Dear Friends,
Please provide the full notes to create ABAP Queries with the T.code SQ01.
Thanks & Regards
Sreehari.

Dear Frind,
My Mail ID - [email protected]
Thanks & Regards,
Sreehari

Similar Messages

  • 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

  • ABAP QUERY , Tcode SQ01, operator OR

    Hi
    I want to create a query that list the purchasing orders created or modified during a given period. however, the creation date and the modification date are two different fields stored in differents tables.
    if I have these two fields in the selection creteria screen, the relationship between them will be the operator AND. so this will not enable me to have the information targeted.
    My quetion, is there a possibility to have the Operator OR in the first selection creteria screen , between these 2 fields.?
    the tables are:
    for the creation EKKO
    for the change :
    MECDGRID
    CDHDR            Change document header
    CDPOS            Change document items
    thanks

    Hi you there.... you can try this
    1) create an abap report with the following source code
    REPORT ZRUN_QUERY .
                          DECLARACIÓNES                                    *
    DATA:
    REPORTNAME LIKE AQADEF-PGNAME.
    PANTALLA DE SELECCION                                                *
    SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME TITLE TEXT-001.
      SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      PARAMETERS: P_BGNAME LIKE AQADEF-BGNAME OBLIGATORY,
                  P_QUNAME LIKE AQADEF-QUNAME OBLIGATORY.
      SELECTION-SCREEN END   OF BLOCK B1.
    SELECTION-SCREEN END   OF BLOCK B0.
    CUERPO DEL PROGRAMA                                                 *
    CALL FUNCTION 'RSAQ_REPORT_NAME'
         EXPORTING
              WORKSPACE  = SPACE
              USERGROUP  = P_BGNAME
              QUERY      = P_QUNAME
         IMPORTING
             REPORTNAME = REPORTNAME.
    CALL FUNCTION 'RSAQ_SUBMIT_QUERY_REPORT'
         EXPORTING
              QUERYREPORT       = REPORTNAME
              VARIANTE          = SPACE
        EXCEPTIONS
             ONLY_WITH_VARIANT = 1
             VARIANT_NOT_EXIST = 2
             OTHERS            = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    2) Create a transaction for this program
    3) Create a parameter transaction and execute this report passing by parameter the usergroup and Query, then, the program will automatically solve the program name and execute it.
    Regards,
    Daniel

  • Schedule a ABAP query from SQ01 to transfer the output to a file path

    I am trying to schedule an ABAP query to run every night and transmit the output as a .TXT file to a particular file path on a server. In the "output format" of the selection screen I selected the second last radio button "File store" and entered the full path and file name.
    When I run this in foreground I get a pop up window confirming the file path before it is downloaded. I have to just hit enter. But when I run in background the file gets transmitted to the spool and not to the file path entered in "File Store".
    Is there any way I can make the file go to the specified path instead of the spool?
    Any help will be appreciated

    See documentation for enhancement SQUE0001. Go to SMOD, enter SQUE0001, and choose documentation.
    I had the same requirement, and I used enhancement SQUE0001 to create a screen exit that adds the selection, "private file". I then created a variant for my query with the private file button selected and the path included, and set up a batch job to run my query with my variant every night.
    Hope that helps.

  • Can we assign Transaction code to created  ABAP Query of  SQ01

    Hi ,
    Friends I want to run the abap query assigning t.code to it .. i will be thankfull if any body give me the steps or remedy .
    thanks

    Hi you there.... you can try this
    1) create an abap report with the following source code
    REPORT ZRUN_QUERY .
                          DECLARACIÓNES                                    *
    DATA:
    REPORTNAME LIKE AQADEF-PGNAME.
    PANTALLA DE SELECCION                                                *
    SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME TITLE TEXT-001.
      SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      PARAMETERS: P_BGNAME LIKE AQADEF-BGNAME OBLIGATORY,
                  P_QUNAME LIKE AQADEF-QUNAME OBLIGATORY.
      SELECTION-SCREEN END   OF BLOCK B1.
    SELECTION-SCREEN END   OF BLOCK B0.
    CUERPO DEL PROGRAMA                                                 *
    CALL FUNCTION 'RSAQ_REPORT_NAME'
         EXPORTING
              WORKSPACE  = SPACE
              USERGROUP  = P_BGNAME
              QUERY      = P_QUNAME
         IMPORTING
             REPORTNAME = REPORTNAME.
    CALL FUNCTION 'RSAQ_SUBMIT_QUERY_REPORT'
         EXPORTING
              QUERYREPORT       = REPORTNAME
              VARIANTE          = SPACE
        EXCEPTIONS
             ONLY_WITH_VARIANT = 1
             VARIANT_NOT_EXIST = 2
             OTHERS            = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    2) Create a transaction for this program
    3) Create a parameter transaction and execute this report passing by parameter the usergroup and Query, then, the program will automatically solve the program name and execute it.
    Regards,
    Daniel

  • Creation of ABAP query

    Dear All,
    This may be a technical question.  I am trying to create the ABAP query by using 2 tables.  Went to SQ02, entered the  description of Infoset and given the first table name in the "Table join in the basis table" row.  When i entered to type the second table name, the program is getting terminated. (If I want to create a query by using one table, then the system accepts)
    If possible, can anybody explain me what could be the proble,?
    Regards
    Manivannan R

    You can post u r req in Expert Forums  » Application Server  » SAP GUI forum
    7.10 is now released, you can get it at
    ftp://ftp.sap.com/pub/sapgui/win/710/compilation1/
    and on
    ftp://ftp.sap.com/pub/sapgui/win/710/patches
    there are the newest patches available.
    http://iris.tennessee.edu/sapgui_vista.htm
    Message was edited by:
            SHESAGIRI.G

  • I am designing ABAP query in SQ01 i have not get one field MATNR

    Dear All,
    I am designing ABAP query in SQ01for MEK2 for Report.
    I  have not get one field MATNR
    I have two table konp and konh i have design in SQ1 i am not get field regarding this table .
    Please Help me.
    Thanks in Advance.
    Regards
    Kumar

    Dear Clemens
    I want MATNR FIELD related to these table.
    I am using KONP AND KONH TABLE .
    Regards
    Kumar

  • Abap query with constante value

    hello,
    I wish to create several abap query since tables MKPF and MSEG for the inventory mouvements. each query for a type of inventory turnover (101, 501,…), but I should not put the code movement in criteria of selection. it is necessary that the code movement should be fixed in the query. should-I declare the MSEG-BWART as a constante? where I can do it?
    thank you for your assistance.
    cordialy Said

    Hi,
    Variant is a good option. Here is one more stable option.
    Other option is to use following Code.
    RANGES : ran1  FOR MSEG-BWART.
    ran1-sign = 'I'.
      ran1-option = 'EQ'.
      ran1-low = 101.
      APPEND ran1.
    ran1-sign = 'I'.
      ran1-option = 'EQ'.
      ran1-low = 501.
      APPEND ran1.
    Then use ran1 similar to select option.
    Hope this will help you.
    Darshan

  • ABAP Query with Debit/Credit Columns

    Dear All
    I need to develop an ABAP Query in which the user should be able to see Debit and Credit balances seperately . I understand that i will have to include two ( DR and CR ) additional fields and then do some kind of coding to pull info from either BSEG/BSIS  ( which one would be better ? )
    table but i just dont know how. Would appreciate if someone can guide me through .
    Thanks
    Sameer

    Bharath
    In some cases when you need to pull info from other tables like this , you create additional fields and then you give joining conditions to pull the information. My Requirement is that i need to develop a query
    Period Year CoCode  G/L G/L Text    Debit Bal  Credit Bal
    Now you dont have Debit and Credit as fields in any table so you need to create those fields and populate it by using suitable codes. Thats what i am really looking for
    Thanks for your effort though
    Just for your Knowledge goto sq02 and hit on extras you will  see those different options

  • Running an ABAP Query with transaction gives error!

    The queries are there (only in production systems), from PHX. When the queries are started from SQ00 they work.
    *The question is, if this has to be done for every single query*?

    Hi,
    When we upgraded, we had only few queries to be generated. Not all the queries were required to be generated...
    Hence would depend on case to case..Better regenerate the query. This is similar to activation. Hence will not be an issues for already generated queries.
    Hope this helps
    Regards
    Shiva

  • ABAP Query: creation of local field (Subtraction between 2 dates)

    Hi,
    I want to create a local field which will calculate the number of days between 2 dates (for example, document date - posting date).
    What I did:
    1) Created the user group in SQ03
    2) Created the infoset in SQ02
    3) I'm stucked at the creation of the Query in SQ01. I'm at the «Create Query: Select field screen». I clicked on Edit --> Local Field --> Create. I selected the «calculation field» attribute. I clicked on the «Complex calculation button», but I don't know how to write my formulate DOCUMENT DATE - POSTING DATE.
    Thanks a lot for your help.
    Julien

    Try these FM's to calculate difference between two dates..
    DAYS_BETWEEN_TWO_DATES
    LEAP_DAYS_BETWEEN_TWO_DATES
    HR_SEN_CALE_DAYS_DATE
    ISB_DAYS_BETWEEN_TWO_DATES
    FIMA_DAYS_BETWEEN_TWO_DATES
    FIMA_DAYS_BETWEEN_TWO_DATES_2
    FIMA_LEAP_DAYS_BETWEEN_2_DATES
    SD_DATETIME_DIFFERENCE

  • Regarding ABAP Query authorization group

    Hi Team,
    This is regarding ABAP Query!
    I have created one authorization group, for testing i have assigned my id in authorization group.
    After creation of ABAP query,standard program got generated. Now i have created one transaction code at the last for the ABAP Query.
    Now the isse is even though i have deleted my id from the authorization group. I am able to execute the query from SQ01 and with the Transaction code .
    It should not happen...i want who soever id is mapped to the transaction code ...that member should only be able to run that query, otherwise there is no use of authorization group.
    Please help me out in this case.
    Thanks & Regards,
    Anil Kumar Sahni

    Are you sure that you don't have access to that authorisation group? Execute report RSUSR002. In the 'Authorization Object 1' block inform  S_TABU_DIS in 'Auth.Object' and accept. Then inform Activity=03 and Auth.Gruop= your group.
    You will get a list of all the users which, theoretically, will be able to execute the query. If you press 'Roles' or 'Profiles' in the toolbar of the listing you will get to know why you have authorisation. May be you have the SAP_ALL profile.
    Also, one more thing to take into account: how have you created your transaction? Is it referring directly to the generated report? Then it is an error, you should execute program SAP_QUERY_CALL. Read this post: [Relate transaction to query;

  • ABAP QUERY STEPS

    Hi Friends,
    can i send me Creation of ABAP QUERY...
    REGARDS,

    What Is SAP Queries
    Many times a need arises for SAP Users and Functional Consultants to generate quick reports without getting any ABAP coding done – time taken to complete the coding in development, transport and test it in QA system and then transport to production – is sometimes too long. In such cases, ABAP/4 query is a tool provided by SAP for generating these kind of reports.
    Type of Report Desired:
    Before starting to write an ABAP query, its advisable to decide the type of report that the user wants. ABAP query provides the following type of reports:
    Basic List Simple report
    Statistics Report containing statistical functions like Average &Percentage
    Ranked List Report written for analytical purpose
    The output is always seen in the order of Basic List, then Statistics and then Ranked List if any. One ABAP query can have one basic list, maximum of 9 statistics and maximum of 9 ranked lists.
    In a nutshell, an ABAP/4 query can be designed in four steps
    - Creation of a user group
    - Creation of functional area
    - Assignment of user group to functional area
    - Creation of the query based on functional area
    The various objects that form an ABAP query can be created in the following 2 ways:
    - Tools => ABAP/4 Workbench => Utilities => ABAP/4 Query
    OR
    - By executing the transaction codes mentioned below:
    SQ01 ABAP/4 Query
    SQ02 Functional Area
    SQ03 User group
    Step I - Create Functional Area
    In the functional area section, the user indicates from which part of the SAP database the data is going to be retrieved and how the data is to be retrieved by the query. One functional area can be assigned to many user groups. A functional area can be created with or without a logical database. To create a functional area with a logical database, one has to mention the name of the database and then select the fields from the tables that form the logical database.
    ABAP Query Authorizations: To use an ABAP query, the user must have appropriate authorizations. Two ways of providing authorizations to the users are as follows:
    - User groups
    The user should be a part of at least one user group to run the corresponding ABAP query. This automatically restricts the access of the user to specific functional areas, and thus the corresponding underlying logical databases.
    - Authorizations
    The authorization object S_QUERY should be used to give proper authorizations to the user for a query. This authorization object has a field named ACTVT which can take values 02 for Change, 23 for Maintain and 67 for Translate.
    This value determines whether the user can create and modify the query. The possible authorizations in the object are as follows:
    S_QUERY_ALL Change, maintain and translate query
    S_QUERY_UPD Change and Translate
    Though the general concept of an ABAP query is moderately difficult, the results and the long term use of the ABAP query is worth the effort.
    Creating the ABAP Query
    To create the query use the menu path Environment => Queries
    · Give a name to the query and click on the Create button
    · Give the description of the query in the next screen. Specify the output length and select the processing option from the Further Processing Options box. The data can be displayed in various formats such as table, download to a file, and display in Word etc.
    · Click on the Next screen icon. Select the functional group screen. All the functional groups created in the functional area are displayed. Select the groups that you desire – fields from only these groups will be displayed in the output. Click on the respective check boxes and click on the Next Screen icon.
    · The Select Field screen gets displayed. Select all the fields from the user group that you need to display on the output of the query. If required, specify the short names for the fields using the menu path Edit => Short Names => Switch On/Off or you can also change the selection text contains in the order you want to appear on the selection screen. You can also maintain column headers for the fields by using the menu path Edit => Column Header => Maintain. 
    ·         Click on the Next Screen icon to get the Selections Screen. Here you can check against the fields that you require to be shown on the selection screen.
    ·         Now we need to specify the output type for the query as Basic List, Statistics or Ranked List. Choose the option Basic List.
    ·         On the Basic List line structure screen the following things can be done
    o        Specify the report layout in detail – lines on which the fields will appear.
    o        Order in which the fields will appear in the output
    o        Sort order for the fields – this is optional.
    o        For the numeric fields you can check against the fields for which you require totals in the output.
    o        Beautify the output according to the options provided.
    ·         Click on the next screen icon, to specify the control levels as mentioned below
    o        Specify the sort order. The default sort order is ascending and can be changed to descending if required.
    o        Totals for each field selected for sorting can be displayed
    o        To display the output of a field in a box click on the check box against box. To display a line after the output of a field, click on the check box against BlnkLn
    o        To display the output of a field on a new page click on the check box against New Page
    ·         Click on the next screen icon to get the List Line options Screen. Here you can specify the background color for displaying the output.
    ·         Click on the next screen icon to get the Field Output Option screen. In this you can specify the following:
    o        Change the output length or the display positions of the fields
    o        Specify the display position of the unit for quantity or currency fields. Click left radio button to display it before the figure, middle radio button to display it after the figure while last radio button to hide the unit altogether.
    o        Specify color for the column of every field under the Format option.
    o        Specify the label against the output of sort fields.
    ·         Click on the Next screen option to go to the Basic List Header screen. Here you can specify
    o        Give page header and page footer for the output
    o        Include user name and date by specifying &N and &D respectively.
    After providing all the above options you can save the query and execute it by clicking the Execute button twice
    Regards,
    Maha

  • Getting error while assigning ABAP Query to Tr.Code

    Hi Guys,
    There is a problem iam facing with ABAP query while transporting which need to solved asap. It will very greatfull if u guys can resolve this problem.
    My problem is, I created one ABAP Query with Name ASSETOVERVIEW. I had transported this even, now when iam going to assign it to one transaction code with se93 lets say ZAOR. I need to give its description and program name in se93 right. now my question is what is program name i need to give in se93. Bcoz in SQ01 where i created the query, there is no name as 'program name' rather there is 'Name' in that we will create the query name i.e, ASSETOVERVIEW. In se93 u give tr.code and when u see down there will be radiobuttons in 'start object',in that i had checked program and selection screen (report transaction) is this right button i had checked or any other i need to check?. I had assigned this name i.e,ASSETOVERVIEW and development class and then when i check the name for syntax check its giving "'ASSETOVERVIEW' does not exist". I don't understand what program name i need to give.
    If u guys can help me out with this problem it will be very much appreciable and definetly can get the reward points.
    Thanks for as usual help in advance.
    Regards.

    Hi omer,
    1. Just run the query.
    2. one selection screen will come
    3. then using SYSTEM---->STATUS, (from menu)
       look for the program name
    4. the program name will be something wired foramt.
    /asdfasdf/asdfdas etc.
    5. Give that name in se93.
    regards,
    amit m.

  • Program of abap query

    Hello experts ,
    I have program with this name : 'AQZZTAD-MM======VENDORS======='.
    I want to see this query in transaction SQ01 , how can i see this query , if i don't know what is the name of this query and i don't know what is the name of the infoset ?
    Thanks for the help.
    AVI.

    Hi
    Please find the Link below
    [Abap Query|Re: sq01 quick veiwer to query]
    [Query|Re: ABAP query]
    Hope this will be help full
    Thanks
    Kalyan

Maybe you are looking for

  • Help in setTimeout function

    I want to pass the argument in the function called in setTimeout function. Below is the code snippet. public function histogramDataPointClick(dataPointObj:Event):void var duration:Number = 5000; setTimeout(executeEvent(dataPointObj),duration); public

  • Universe Design approach - Dimensional Data model

    We use a Dimensional data model which has about 15 different models based on Subject areas. Eg: Billing, Claims, Eligibility, etc. Each model has its own Fact table linked to Dimensions, some of which are Conformed dimensions which is present in mult

  • Albums by year??

    I asked for the 'years' in my itunes library headings. They appeared, but the Albums were now listed by year, too. I have deleted the year catagory and also the album catagory on the view options pull down. When I check 'album' again, I get 'album by

  • Module Program in  Mail adapater

    Hi , I have a mail adapater and i am sending mails using that adapater . I wanted my XI e-mails to look more like normal e-mails so i refered the blog /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter but now my

  • Dragging from iPhoto makes the screen go all weird

    Since I updated to Lion, there's a problem I have when using iPhoto in which when dragging from iPhoto onto the desktop (or anywhere else outside of iPhoto) the portions of the screen outside of iPhoto go all jittery, and are filled with random jumbl