Order by preffered over sorting.

Hi All,
SELECT ITAB ORDER BY preferred over SORT ITAB
which one is more preferable??
For example I have the selection query:
      SELECT  matnr
              werks
              charg
              clabs FROM mchb INTO TABLE i_mchb
       FOR ALL ENTRIES IN i_qals
       WHERE matnr = i_qals-matnr
        AND werks  = i_qals-werk
        AND charg = i_qals-charg.
      IF sy-subrc EQ 0.
        SORT i_mchb BY matnr
                       werks
                       charg.
If I want to implement the same by using Orderby in the select query instead of seperate SORT,
what should the query be like?
and which is preferable and why?
Thanks,
Debrup.

Hi,
Instead of Order BY in select statement Sort is preffered. Order by consumes the Database time.
Preferebly the Sort statement is better.

Similar Messages

  • How do you geT ICal to print out the To Do Items in the same order as you have sorted them on the screen

    How do you geT ICal to print out the To Do Items in the same order as you have sorted them on the screen

    Without actually seeing some of what is in the .ics attachment there's really no way to see what's going on.

  • Purchase Order error - Money Over flow error

    Hi,
    Our customer wants to create Purchase order for item that has Lenght, Width, Height dimentions (not defined in item master used directly in PO).
    Width - 2500mm
    Length - 2500mm
    Height - 550mm
    the quantity in PO is to be in Kilogram (KG) as the rate is Rs per KG. So when we put quantity as 9890 KG there is error
    " Money Over flow, cannot display all digits"
    Looking in more details , we found that there is volume field at row level in PO which system calculates,
    volume = Length * width * height, (for 1 item) but when we add quantty system does
    volume = (Length * width * height) * Quantity, the resulting value is more then 20 characters, inluding the commas.
    We think this is reason for error,,,any one else faced similar situation and has solution for it.
    can we stop system from calulating Volume or the way it calculates volume?
    Please advice
    Thanks,
    - Abhijit.

    Thanks Gordon,
    Your reply helped me solve the problem, there is a VOlume unit field at row level on PO, changed the UoM there to "cm" instead of "mm" earlier/default. Now we can add the document.
    Thanks.
    - Abhijit.

  • Pre-Order single won't sort correctly once album downloads

    I pre-ordered Ryan Adams "Easy Tiger" and got the single "Two" immediately downloaded. When I downloaded the rest of the album today, it did not re-download the single with the rest of the album. When I tried to fix the sorting issue by changing the info fields (album name, track number of X, etc) nothing worked. Itunes and my Ipod still put this song at the end of my album. This drives me nuts. Any help?

    I'm having the exact same problem with the exact same album - Ryan Adams / Easy Tiger, and the single Two.
    I have noticed that the album tracks are marked Explicit, while the single is not, but that's the only difference I can see.
    Like jtrieb I've tried changing the album name and fixing the track number to be 2 of 12 to fit in with the rest, as well as sorting by track number and then album, to no avail. It insists on remaining at the bottom of the list.
    Note that I'm not using iTunes for Windows (found this thread via search), but iTunes for Mac OS X.
    PowerBook G4   Mac OS X (10.4.10)   iTunes 7.2 (34)

  • Trying to make a book - iPhoto changing the order of my manually sorted album.  Help?

    I'm trying to make a book from an album. 
    I have manually sorted the photos in the album and wanted autoflow to fill the book in.
    However, when I create a new book from the album, iPhoto seems to re-order the photos by one of the other options (eg: by date.)  If I change that sort option under view - sort, and switch it to manual, it wants me to manually re-sort based on the previous setting.  I have already done my sorting in the album.  Is there a configuration I can do that will get iPhoto to recognise that manual album order?
    (iphoto 11 v9.2.1)

    The only solution I've seen reported is to change the dates of the photos using the batch change command with a increment so the date sort will be the same as your manual sort - you can search the forum for one of these posts - and I do not remember how they proposed to undo the date change
    LN

  • Designerd does not generate Order BY code for Sort Order on a lookup tabel column.

    I am setting the Sort Order on a column which is based on a lookup table.
    When generate the the module, designer does not generate the code for the Sort Order that I set on the lookup table column.
    Is there a work around for this problem or is there some thing else that needs to be done in designer to make it generate the order by clause?
    I will very much appreciate help.
    Regards
    Prasad.

    A bound lookup item, will be generated as a NON-database item in Forms. Designer generates an ORDER BY CLAUSE (a Forms Block property) for the ordering. But a NON-database item cannot be included in the ORDER BY CLAUSE.
    I used a stored function for ordering the lookup item.
    Best regards
    Harm van Zoest

  • Does refreshing the order status page over and over push delivery dates up?

    I've been a caged animal for the past week. Pacing back and forth methodically refreshing the page every 5 minutes. I couldn't eat, sleep, nor defecate. I did nothing but wait. I waited for the return of my 9/19 delivery confirmation for my gold iPhone 6 Plus 128GB. During this time my delivery date has been bounced around more than the two balls I always carry. As of now, the fruits of my labor has resulted in a 10/14 delivery date. What progress. Should I stop refreshing the order status page? Does anyone know if refreshing the page over and over pushes the delivery date up? TIA.

    Settle down, eat something, take a nap or something. It's just a phone. Wearing out your mouse refreshing the page is not going to make your phone come faster.

  • What order are iPhoto events sorted when synced?

    When I sync the last xx months from iPhoto to my iPhone via iTunes they certainly aren't alphabetical and they are in no sort of chronilogical sorting when I look in iPhoto. Does anyone know how sorting is decided there in the Events album in the photos app? I'm on iOS 7.0.3 FYI.

    So, turingtest2 has it exactly right... Unwatched movies view is sorted by Album Artist.  So here's a nice little fix for that... you can go through and manually copy the Name of the movie into the Album Artist field, but if you have a lot of movies in this category, it will be tedious.  A better option, is to go to www.dougscripts.com, and download the This Tag, That Tag applet.  You can find a link here.  You can then select ALL of your unwatched movies, run the applet, and elect to copy the movie Name into the Album Artist field.  Boom!  And since Doug has done such an awesome job of saving you a bunch of time and effort, throw him a little donation.
    Peace,
    Jared

  • When I look for a website to go to the addresses I put in are shown in a drop down menu but they are not in alphabetic order, how do I sort it permanantly?

    I have set Googleas my homepage when I look for a webaddress the drop menu displays the sites however they never stay in alphabetic order, how can I set it so that this happens?

    See this link - http://kb.mozillazine.org/Sorting_and_rearranging_bookmarks_-_Firefox

  • Order specific control over condition type

    Dear Gurus...
    There are two oder (sales docments)types  and two condition types, out of them one condition type has to be applicable for both order types and another condition type has to be applicable only for one order type how to configure....
    This is Project Manager interview question any idea please help to rescue...
    Thanks in advance
    siva

    Hi Siva,
    You do like this
    You define two pricing procedures
    In one procedure you put both condition types(For Ex ZZZ1).
    Iin second pricing pricedure you put onecondition type which is applicable to both the document types(For ex:ZZZ2).
    You define two different document pricing procedures to that order types.
    Document pricing procedure for Both conditions order Z1
    Document pricing procedure for single condition order Z2
    Assign that document pricing procedure to those sales document types.
    Now you do the two pricing procedure determinations differently based on the new document pricing procedures.
    Sales area+Z1-->ZZZ1
    Sales area+Z2-->ZZZ2
    Now you can get one condition type in both order types and another condition type only for one order type.
    I hope it will clear for you,
    Regards,
    Murali.

  • Ordered iPhone 5 over the phone 10/3 and have not received any notification...

    I used an update on one of my other lines on the account and still have not received any notification that I even ordered it. The only thing it says is we can no longer update the phone line we ordered it on because we are waiting to receive and activate a new device. I can't even track or know that Verizon put in an order for the account for the iPhone 5. What should I do? Is anybody experiencing this? Should I call? I swear if they didn't put my order in and I get this new 11/2 push back date, I am gonna be really, really, upset.

    Did they by chance give you a conformation #. I know i ordered my on the Sept.14th. I had an expected delivery date of Oct. 5th everything was good and got the conformation that my upgrade went through even. I got worried about mine when I knew they had been shipping the phones early and they still by the 3rd had not charged my card. It turned out after my order was confirmed they lost the order, I didn't get the confirmation "EMAIL" after getting my confirmation # online. So i had to reorder my phone on Wed. because they had no record of my order even being placed. It may be a good thing that they atleast show you still have an order in though.

  • Submit order using Webservice over JMS

    Hi,
    from the SDK samples(webservice sample) and from one of the reply from the forum:
    The wlsmimehdrContent_Type JMS header must be set to the following value: text/xml; charset="UTF-8"
    The URI JMS header must be set to the following value: /osm/wsapi
    Want to test webservice over JMS using SOAP UI (that supports HermesJMS):
    I have configured HermesJMS then configured SoapUI 4.0 by adding endpoint as JMS then selected webserive endpoint as JMS:osm_ws_request (long name) instead of "http://localhost:7001/osm/wsapi".
    Now for JMS endpoint where to add webservice URI "/osm/wsapi" unable to figure out where to add URI (in SOAPUI or HermesJMS) which parameter need to set for webservice URI?
    Regards,
    Rutvej

    Hi,
    Above query is resolved..
    Cheers,
    Rutvej

  • OOP code review

    Hi,
    Can anyone help me on checklist for a OO-ABAP prog code review?
    Thanks.

    Hi,
    Here are some. I dont have a link and site which can give u all that.
    Shall give a few points here:
    1. The nesting of IF statements should be limited.  When multiple conditions are being tested, the appropriateness of the CASE statement should be considered
    2. The CASE statement uses WHEN OTHERS
    3. When possible, do not use the TRANSLATE statement, because it is not efficient.
    4. Always specify your conditions in the Where clause instead of checking
    5. SELECT INTO preferred to SELECT
    6. Avoid select * to the max.
    7. Use primary key while selecting.
    8. Avoid nested selects and nested loops
    9. Avoid the use of the ORDER BY clause on a SELECT statement that sorts by non-indexed fields. 
    10. SORT ITAB ORDER BY preferred over SORT ITAB
    11. Use multiple MOVE statements instead of a single MOVE-CORRESPONDING statement.
    12. LOOP…WHERE is prefered to LOOP/CHECK
    13. use binary search while readin
    14.      Itab2[] = Itab1[] is preferred to
         Loop at Itab1.
         Itab2 = Itab1.
         Append Itab2.
         Endloop.
    15. use DESCRIBE instead of COUNT
    Hope these will help you your review process.
    Also check out this link:
    http://www.sap-basis-abap.com/abap/abap-4-development-code-efficiency-guidelines.htm
    http://www.ams.utoronto.ca/userfiles/page_attachments/Library/1/Developmentstandards_guidelines_335678.pdf
    Best Regards,
    Anjali

  • How to update a table in order to have a costumized sort.

    Hi,
    I have a table that is used by an application that as the following struture:
    key1 key2 filename
    1      2      MY_SOURCE2_20110701
    2      2      MY_SOURCE2_20110702
    3      3      MY_SOURCE3_20110701
    4      3      MY_SOURCE3_20110702
    5      4      MY_SOURCE4_20110702
    6      4      MY_SOURCE4_20110703This table is used by a program that will get the values and process it using key1 as the order by field.
    I cannot change the application and the problem is that now I've applied a module that requires to process the information by date.
    The filename struture is always the same and similar to the one I described.
    So before starting the processing I need to reorganize the rows in the following format:
    key1 key2 filename
    1      2      MY_SOURCE2_20110701
    2      3      MY_SOURCE3_20110701
    3      2      MY_SOURCE2_20110702
    4      3      MY_SOURCE3_20110702
    5      4      MY_SOURCE4_20110702
    6      4      MY_SOURCE4_20110703This is: I need to maintain the key1 values and i need to move the key2 and filename in order to have them sorted by date.
    I'm thinking on solution but i need to keep in mind this is a table that is often used to do inserts and updates and it has near 1 million records average.
    My ideas:
    create a temporary table with the results of:
    select key1,key2, filename from input_table
    create two cursors:
    create cursor1 as select key1 from input_table order by 1
    create cursor2 as select filename, key2,substring(11,8) as date from input_table, order by 3
    while fetch cursor1.next cursor2.next
    set filename = cursor2.filename and key2 = cursor2.key2 where cursor1.key1= input_table.key1The other solution I'm thinking is to create a transaction to lock the table while this is being performed. and avoid the creation of the temporary table.
    I don't like the first idea because I don't want to use temporary tables.
    I don't like the second idea because I don't want to lock the table every time I need to do this operation.
    About second option I have a question that may be preventing me from using this solution:
    - If instead of locking a table I just lock a specific key2 value will it use the same locked rows for both cursors or if any insert happens between both executions the information will be incoherent?
    create two cursors:
    create cursor1 as select key1 from input_table where key2 in (1,2,3) order by 1
    create cursor2 as select filename, key2,substring(11,8) as date from input_table where key2 in (1,2,3) order by 3
    while fetch cursor1.next cursor2.next
    set filename = cursor2.filename and key2 = cursor2.key2 where cursor1.key1= input_table.key1Can someone advice me on any other possible way to implement this?
    Best regards,
    Ricardo Tomás

    Hi, Ricardo,
    Why do you need to do this? What is the business requirement that demands this? It seems like a waste of time and effort, and you'll have to re-do it every time a row is INSERTed or DELETEd, or when any of the columns involved is UPDATEd.
    Given that you really want to do it, here's one way:
    MERGE INTO     table_x          dst
    USING  (
               WITH    got_nums     AS
                   SELECT  key1, key2, filename
                ,       ROW_NUMBER () OVER ( ORDER BY  key1 )
                                                       AS key_1_num
                ,       ROW_NUMBER () OVER ( ORDER BY  SUBSTR (filename, -8)
                                                   ,         key2
                                  )     AS filename_num
                FROM    table_x
            SELECT  k.key1
            ,        f.key2
            ,        f.filename
            FROM        got_nums     f
            JOIN        got_nums     k  ON  f.filename_num  = k.key_1_num
           )               src
    ON     (src.filename     = dst.filename)          -- or any unique column(s), not including key1
    WHEN MATCHED
    THEN UPDATE  SET  dst.key1 = src.key1
    ;If you'd care to post CREATE TABLE and INSERT statements for the sample data, then I could test it.
    As posted above, this assumes that filename is unique. If not, you'll have to change the join condition between src and dst to guarantee a unique match.
    This does NOT assume that filename is always 19 characters; only that it is at least 8 characters, and that the last 8 characters determine the order.

  • Sort order on sync'd photos

    I'm trying to get 400+ photos onto my iPad from iPhoto. I cannot use sync because it destroys the sort order I have established in iPhoto.  Have tried to sync, have tried to export to a folder. The folder export put the photos in the sort order I want but when I transfer to iPad - once again they are scrambled.  Photos that have names like pix-1, pix-2, ... appear all over the album.  Does anyone know how to keep the sort order when transferring (by any means) to the iPad?

    What sort order do you have selecting in the sort drop-down?  There is no "correct" sort order.  You can sort on any metadata you can show in the Browser.  The sort drop-down is located in the top border of the Browser, near the left corner.  Every container in Aperture retains the sort order it last had.  When you manually move an Image in the Browser, the sort order is changed to "Manual".

Maybe you are looking for

  • How can i perform system image recovery in windows 8.1 hp pavilion g6

    recently i upgrade my hp pavilion g6 to 8.1pro..i need to create an system image file of my windows 8.1..so plz give me a detailed procedure...to store it on dvds/online hp backup recovery...                                                Is this ima

  • No Camera Found message when connecting iPhone

    Hello, I am experiencing an annoyance where I plug in the iPhone to my imac and I get a message that reads "No camera found. I have Canon Software installed for my camera. Anyone experiencing the same problems or have a solution. Many thanks.

  • 2007B PL20 upgrade issue

    Hi all experts, i am upgrading a customer from 2007B PL14 to PL20. However, i am stucked at the very first step of upgrading Server Tools, when i keep encounter an error saying "Error Accessing Parser.DLL ........................ " i read all related

  • Iphone not detected

    when i connect my iphone 4s to itunes it is not finding it. when i connect my phone it opens iphoto..

  • Unexpected price increase

    I just went through this issue with an on-line agent. It seems that I was receiving a 1-year promotional discount that just expired. Comcast would be well served by being proactive and let their customers know in advance that the promotional period h