ABAP Query - Sorting Issue in Basic List (SQ03)

Hi,
    I have developed a ABAP Query. I want to sort some of the fields, for which I need to add some output fields to the sort sequence box in the Basic List page in SQ03/SQ01. But, I am not able to drag and drop the fields directly. Please suggest how can this be done? Thanks in advance.
Best Regards,
Tejas Savla

Hi Abhishek,
There are three things related to Query.
1) You have to create the USER GROUP in SQ03.
2) You have to create the Infoset in SQ02. In this infoset you can write the logic of the program/Query what ever you want to perform.So you can sort the table in the infoset in the program logic.you have to create the output table of the query.
3) you have to create the Query in SQ01 and you have to associate the User group and infoset . you have to design the layput of the output you want to have.this output fields would be same as you have defined in infoset(step 2).
hope this will help you.
thanks
Tanmaya

Similar Messages

  • ABAP Query layout issue

    Hi,
    I need to add a new column in a ABAP-Query, while adding this column and executing the same. The layout has changed from custom to standard one.
    Is there any way to retain the custom layout in the "Basic List" while changing the Infoset Query.
    Thanks in advance.
    Best Regards,
    Gopi

    hi,
    I guess the transaction code directly calls the generated ABAP program, which is the bad approach, because the generated ABAP program might have different names in different systems (like here). You have to create a transaction, which calls transaction START_REPORT with the following parameters/attributes filled :
    D_SREPOVARI-REPORTTYPE= AQ "parameter indicating Abap Query
    D_SREPOVARI-REPORT= '...' "Query User group
    D_SREPOVARI-EXTDREPORT= '...' "Query name
    Of course you have to replace the dots with real usergoup and query names. You create this transaction code in the development system and transport it to test and production. It will work everywhere (in case the query is transported as well).
    hope this helps
    ec

  • Query Throttling issue after increasing List view threshold in connected webpart

    Dear SharePointers,
                                   I have connnected listview webpart deployed on site. Parent webpart
    has 16 fields and over 3,000 listitems exists in list. Child webpart has 7 fields and more than 30,000 Items. The code works well in other sites in same web app and it also works well in other systems. We tested same in other system by increasing/decreasing
    data but still we are not able to replicate issue. I know that this issue could also encounter if fields are not indexed in the list. Are there any other pointers which can use to debug this issue.
    Milan Chauhan
    Regards,
    Milan Chauhan
    LinkedIn
    |
    Twitter | Blog
    | Email

    Hi,
    According to your post, a Query Throttling issue occurred after increasing list view threshold in connected web part.
    By default, this limit is set to 5,000 items for regular users and 20,000 items for users in an administrator role.
    More information is here:
    http://msdn.microsoft.com/en-us/library/ff798465.aspx
    Please try to enable the Daily Time Window for Large Queries:
    1.Go to Central Administration-> Application Management -> Manage web applications.
    2.Select the web application that contains the large list.
    3.Click General Settings, and then click Resource Throttling.
    4.Under Daily Time Window for Large Queries, click to select Enable a daily time window for large queries.
    5.Set a start time and duration when most of your users will not be working.
    6.Click OK.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • ABAP query transport issue

    Hi,
       I have copied an abap query ZGA to ZGA_IND1 and changed the title to INDIA.  I gave transport number and released and transported to Quality. A transaction has been assigned to this Query
      But when I execute this query from Quality machine using transaction, it says program AQZZZGA=========ZGA_IND1======   is missing.
       Transaction code is transported but not the ABAP query program.  I retransported and failed couple of times.
    Not sure why underlying program is not transpoorted to Quality.
    Any idea, what I am missing here.
    Cheers.
    Sudhaker

    hi,
    I guess the transaction code directly calls the generated ABAP program, which is the bad approach, because the generated ABAP program might have different names in different systems (like here). You have to create a transaction, which calls transaction START_REPORT with the following parameters/attributes filled :
    D_SREPOVARI-REPORTTYPE= AQ "parameter indicating Abap Query
    D_SREPOVARI-REPORT= '...' "Query User group
    D_SREPOVARI-EXTDREPORT= '...' "Query name
    Of course you have to replace the dots with real usergoup and query names. You create this transaction code in the development system and transport it to test and production. It will work everywhere (in case the query is transported as well).
    hope this helps
    ec

  • ABAP Query Performance Issue .

    Hii
         I need to print a very simple list of materials & there corresponding latest movement date for a specified period of say '365 Days'.
              Now for this i have written a join on MSEG & MKPF tables .but the issue is,this join gives me a very large number of records as all the material documents for that material in that period are fetched ,then i sort this table descending on date & delete other records.
      I just need to get that record of latest date (material document with latest date).How could that be done without fetching the other records ?
    Regards
    Ajitabh

    1. try to create/ use secondary indexes on MSEG and MKPF.
    2. Dont use For all Entries in this Join .
    it should be like this.
    if s_matnr[] is not initial.
    select a~mblnr
             a~mjahr
             a~vgart
             a~budat
             a~xblnr
             b~zeile
             b~bwart
             b~matnr
             b~werks
             b~kunnr
             b~shkzg
             b~menge
             b~meins
       from  ( mkpf as a join mseg as b
       on    a~mblnr = b~mblnr  and
             a~mjahr = b~mjahr )
       into  table t_mseg
       where a~budat ge s_date-low     and
             a~vgart in ('WA' ,'WL')   and
             b~matnr in s_matnr        and
             b~werks in s_werks1       and
             b~sobkz eq 'V'            and
             b~kunnr eq w_cust         .
    endif.
    Regards
    Prabhu

  • 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

  • Question about ABAP Query

    Hi,
    I have a SQ01 query .. based on that query i have to call another query
    ie : when my basic list gets diplayed .. after i click on it a detailed list should be displayed (this again is another SQ01 query)... is this possible through abap Query and if it is where am i supposed to code this
    Thanks a lot in advance

    HI
    GOOD
    GO THROUGH THIS LINK
    http://www.ams.utoronto.ca/Asset353.aspx
    THANKS
    MRUTYUN

  • How to execute ABAP QUERY.

    Hi all,
            I know how to create ABAP QUERY using transactions SQ01,SQ02 and SQ03.But after creating it how to and where to use it.
    Rgds,
    Tkp

    Hi,
      Check this link..
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    Thanks,
    Naren

  • Hyperlink on field in Basic list of ABAP Query

    Dear All,
    Could somebody tell me, if its possible to have a hyperlink on a field in the Basic list of ABAP Query (SQ01,SQ02).
    Example :- There is a basic list which has the field MARA-MATNR displayed.There should be a hyperlink on this field, such that when the user clicks on it , the transaction MM03 is called.
    Thanking You.
    Ranu

    Hi,
    Loop at itab.
    write:/ itab-matnr hotspot,
              itab-maktx.
    hide: itab-matnr.
    endloop.
    data: c_field(16).
    at line-selection.
      get cursor field c_field.
      if c_field  = 'ITAB-MATNR'.
        check not itab-matnr is initial.
        set parameter id 'MAT' field itab-matnr.
        call transaction 'MM03' and skip first screen.
      endif.
    This is one example to call the transaction.
    If this helps you award points.
    Thanks,
    Deepak.

  • ABAP Query --List Width

    Hi,
        I have a requirement for ABAP Query using transaction sq03.
    I have to add a new column and since the field length is char132, when i place the field in "Basic List" tab in Sq03, the field goes to the
    next line.Now, when I execute the output, only the fields in the first line (in Basic List) get displayed. The fields in the second line do not get displayed. Also, I cannot fit the second line fields in the first line as the maximum list width is 254. I need a solution to display the 2nd line fields in output.
    Thanks in advance.
    Regards,
    Tejas Savla

    Hi Teja ,
    what u can do is , change its display length of that field .
    SQ01---> In the change Mode --->basic List ---> Click on the Field --->Down Left u will get options to change display length.
    regards
    Prabhu

  • How to sort the fields in ABAP query.

    Hi all
    I am not able to drag the fields in Sort tool box.
    Please help me how to add the fields in Sort tool bar.
    Regards
    Gangi

    In SQ01, when we are creating a query, we can define the default sort sequence & Totals also.
    This can be done when defining the basic list.

  • Header & Footer in Basic list of infoset Query.

    Dear Experts,
    In an Infoset Query, I have been trying to make use of the Header & Footer Features (available in the Basic list screen) for quite sometime, but with no success.
    Even though I add these, they do not appear in the list output.
    Please throw some light of knowledge in this regard.
    Regards
    Jogeswara Rao

    The Header & Footer text in the Basic list of Query will only be shown in the "ABAP List". Not sure if you are are looking at the Header & Footer text in SAP List Viewer.

  • Query and sort content from two lists using search API

    Hi,
    I have a custom web part which I would like to query two different lists and sort the results by Created Date. One is a list of news articles and the other contains blogs. So basically the result set will be an intermix of news and blog items sorted by date.
    I would also like to do this by query through the search API. Does anybody have any sample code to do this?
    thanks,
    Sherazad.
    Sherazad

    Hi Sherazad:
    To use the JOIN operator in CAML, your lists must have a
    defined relation(Lookup column). You can refer to sample code that I list as follow.
    Create your query from one of your lists.
    SPList Projects= SPContext.Current.Site.RootWeb.Lists["Projects"];
    SPQuery query = new SPQuery();
    To do the join, setquery.Joins
     <Join Type="INNER" ListAlias="Contacts">
        <Eq>
            <FieldRef Name="ProjectManager" RefType="ID" /> ///
    ProjectManager is a Lookup Column.
            <FieldRef List="Contacts" Name="ID" />
        </Eq>
     </Join>
    And query.ProjectedFields (To tell SharePoint how to project the lookup columns into the result)
    <Field Name="Project Name" Type="Lookup" List="Projects" ShowField="Title">
    /// My Project Name is a Display Name in Memory so you can give a name by yourself But ShowField must be Internal Name of the Column(Project Name)
    You can add a lot of columns that you want to display.
    Everything comes from memory.
    To choose the fields to display set query.ViewFields
    <FieldRef Name="Your Internal Name of Column Or
    ProjectedFields - Field Name">
    <FieldRef Name="Your Internal Name of Column Or
    ProjectedFields - Field Name">
    <FieldRef Name="Your Internal Name of Column Or
    ProjectedFields - Field Name"> 
    Then
    SPListItemCollection result = ListA.GetItems(query);

  • Abap query issue.

    Hi ,
    I have an existing abap query whose infoset has logical database ADA.
    Now I have to add a new table ANLC to this existing query .
    My main task is to add 3 new fields in the output of the existing abap query  One is a direct field from the ANLC table namely  Acquisition value and 2 other fields will be derived from the following formula :
    anlc-Acc ordinary depreciation + anlc-Ord. depreciation posted = Total accumulated depreciation.
    NBV = Acquisition value u2013 Total Acc depreciation
    Could you please sugest:
    1.  how to add  the ANLC table in the query?
    2.  How to calculate the above two fields and populate the output in an abap query?
    Thanks,
    Suchi.

    No, above mentioned is not the solution for your problem.
    I believe you want to write ABAP Query (i.e. Tcode SQ01), NOT the SQL Query in a normal program.
    Now, if you want to put abap code behind a field in your SQ01 query then you need to create custom field in your infoset. To learn how to create custom fields I have written a blog: SAP Adhoc Query SQ01 SQ02 SQ03
    Good news is that you do not need to create custom fields for the requirement that you mentioned.
    i want to fetch data where one field begins with 1* or 2* or 3* or 4* .
    For this, simply put the field on the selection screen by selecting appropriate check box and just use 1, 2, 3* or 4* in on the selection screen.
    Where should i COUNT the data selected and display it .
    when you execute the report, click on the 'Layout' icon, and select 'Column for number of rows'. It will give you last row with count. You can then save the layout as default layout so that it appears automatically.
    If you want to do anything different than above then you need to create custom fields, see my blog for that.

  • Issue in ABAP Query varient

    I have created the varient name CUS& for attaching the abap query varient in tranport request.  I have done this. but I am geting following error. please help me on this. thanks.
    The varient is created as Protected by default. I can't able to create the varient unprotected. Can you tell me how to create unprotected varient for SAP Query? becuase other user can't able to change the varient it is giving the error message with my user name as " No authorization to change the varient <varient name> Protected by <my user name>".
    Please could you help me how to fix it. this issue?

    Hi
    Thanks for your inputs.I am using ABAP query for first time. Can you advice where to check for same.
    Regards
    Dinesh

Maybe you are looking for

  • SAP R/3 System analysis before upgrade 4.6C -- SAP ECC 6.0

    Hello! Before the upgrade from R/3 4.6C to ECC 6.0 I would like to execute SAP R/3 system analysis. The following functions should be included in this program: - detailed analysis of system modifications (effort driver and risk factor during an Upgra

  • How to upload a file into a db blob column from adf page

    How to upload a file into a db blob column from adf page Which option to use ?

  • Email delivery failed. unable to send and receive email for da device 9780 bold

    Hellow, I m using BlackBerry® 9780 smartphone (3G, Wi-Fi) 6.0 Bundle 863 (v6.0.0.285, Platform 6.5.0.54) 3G Bands 1,2,5,6 Cryptographic Kernel v3.8.6.5 Branding Version: 1.0.99.538J Micro Edition Configuration: CLDC-1.1 Micro Edition Profile: MIDP-2.

  • How to PL/SQL Function returns type

    Hello, I need to create a function, which is returning a list of ID's, which is stored in a type T_IDs, something like: function search(searchstring in varchar2) return T_IDs I have a little problem with filling the type inside the function body usin

  • Red exclamation mark in battery icon

    I have Z30. When I am switching on my phone, first it shows the blackberry logo then a red battery icon with exclamatory mark shows and turns off. Device is not switchng on its showing the same thing also while connecting with charger. Please provide