Is sort an expensive statement

Hi Experts,
Is it good practice to use sort statement  before ,
Select for all entries statment.
Before select for all entries statement we are checking about if not Itab[] is initial.
Is sort an expensive statement.
Thanks in Advance
Irfan Hussain

Hi Irfan
you have sort the internal table on the same field in which your for all entries condition is then it will improve your performance.
for ex.
sort itab by vbeln.
select * inot table itab1 from vbap for all entries in itab where vbeln eq itab-vbeln.
regards
kishore

Similar Messages

  • Least expensive statement...

    I wrote a least expensive statement and that is :
    select 1 from v$parameter where 1=2;
    Are there any others that are more least expensive statements ?
    Thanks,
    Siva

    SELECT null FROM dual

  • Using temporary tablespace for sort in select statement without spacifying

    how can i use some particular temporary tablespace in select statement for sording without allocating any temporary tablespace to that user

    Try to set for the current session the in memory sorting space to 0 before running your query:
    SQL> alter session set sort_area_size = 0;The query should use the temporary tablespace.
    Message was edited by:
    Pierre Forstmann

  • Is it possible to sort contacts by state?

    I need to sort my contacts by state of residence.  Is this possible?

    CC,
    You probably had something in mind when you applied the colors to the text. It's always best to record the conditions directly rather than to indicate them indirectly by by use of color.
    You can use Conditional Formatting to do some color coding based on the condition. You might even find that it's easier to let the conditional format tool than to assign the colors manually.
    Jerry

  • Sorting question over state...

    Hi there,
    Anyone know where you amend the over state / hover of an option in a sorting question ???
    Been looking in the object style manager but can't find it in there...
    Thanks in advance...

    You are talking about the partially transparent grey bar that appears when hovering over an answer in the Sequence type of questions. There is no style that can be customized AFAIK. It is not even changing with the included themes. Same is valid for the connecting lines in matching questions that are always black, color cannot be changed for them neither. It is a pity, would recommend you enter a feature request to be able to customize the color of both the hover bar and those lines.
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    Lilybiri

  • Sort by Expense Report Number in PR05

    Hi Gurus
    Is there a way to sort out by the Expense Report Numbers in PR05 ?
    My client wants to see all the Trips with status "Trip Completed" and "Open/To be Settled", on the top for easy identification, rather than looking for the Expense Report with the above status, scattered among the available Expense Reports in PR05
    for "Approval" and "Settlement".
    Thank you
    RRoy

    Hi,
    In PR05, I am not confirm weather sorting is available, however very good filter option is there (Menu -> Edit -> Selection Criteria)
    You can filter based on number of combination ( For example "Trip Completed" and "Open/To be Settled")
    Regards,
    Muhammad Umer

  • Expensive statement on DB

    Hi,
    The following statement is expensive on the database. Kindly provide me the certain change to improve the performance.
      refresh i_hrp1000.
      select objid begda endda mc_short from hrp1000 into table i_hrp1000
             where plvar = c_plvar
             and   otype = c_otype
             and   istat = c_istat
             and   langu = sy-langu.
    Rgs
    Krishna

    Hi Krishna,
    try to add additionla parameters and  set some default values to minimize the select statement.
        select single
               objid begda endda mc_short
               from hrp1000
               into l_pdesc
               where otype = c_otype
               and objid = pernr-plans    "<<  pass this
               and istat = '1'                  "<<pass this
               and begda le sy-datum   "<<pass this
               and endda ge sy-datum.  "<<pass this
    Regards,
    Prabhudas

  • Sorting contacts by state

    How can I show all the contacts that live in a given state? Searching works semi-OK for states like AZ, but fails for most because "ca" is part of many names and places. It seems like this would be easy - and I have 15 yr experience with macs being easy. Can someone clue me in?
    Thanks,
    Zak

    Perhaps try Smart Folders?

  • Database load from expensive statements

    Hello Experts,
    My Query is what is the highest threshold value of CPU Load. i think this value is average CPU load of the month in EWA report.
    In our Ewa report
    values are like
         Buffer Load [%]     Disk Load [%]     CPU Load [%]
         19                            34                                            35
    Currently my system is running on SAP4.7, DB -> Oracle 10g 10.2.0.4, OS -> HP-UX 9000/800
    Our current DB size is 4 TB.per month databse growth is around 230 Gb
    We are planning for harware capcity when our database will rise to 10 TB in 2 years time.
    Waiting for your response

    Hello Experts,
    I am trying to use Quick Sizer, but unable to open the Beginner link.
    and can someone help, how to use the quick sizer tool.
    Regards

  • Expensive SQL Statements of the day?

    Hi...
    How can i find out Expensive SQL Statements of the day please.?
    Our SAP Version is ECC 6.0 on Oracle 10.2.0.4.0
    Rgds

    Hi Srinivas,
    On ECC 6.0, go to ST04 t-code --> performance --> SQL Cache --> You see SQL Statements where you need to sort by SQL Statements by Total Execution Time(ms).
    I have tried on one of my R/3 4.7EE system, ST04n --> Resource COnsumption --> Top SQL Statements --> you will see 50 Top most expensive SQL Statements interms of wait time.
    also Read: [Re: Diagnosis of the expensive ABAP programs having database time > 90%;
                      [Please Read before Posting in the Performance and Tuning Forum;
    Regards,
    Kanthi Kiran

  • Sort remuneration statement (report RPCEDTP0)

    Dear gurus,
    I need to find an exit for report RPCEDTP0, because a need to sort the remuneration statement by name and last name.
    The standard button SORT ORDER from report RPCEDTP0 is not giving me what I need...
    Does anyone know something that may help me?
    Thank you in advance,
    PC

    Hi Ted Dinh!
    Your advice seemed to be such a good one... but I'm not having success
    I created an enhancement in form 'FILL_SORT_CONDITION_TABS' ( include: 'LRPPNTOC') and inserted this code inside it:
      SORTORDERS-FIELDNAME = 'ENAME'.
      SORTORDERS-POSITION = '26'.
      APPEND SORTORDERS.
    But when I click on button 'SORT ORDER'... I don't see any difference..
    Do you have some idea of what can be happening?
    Regards,
    Priscila

  • Financial Statement Structure(Functional Area)

    Dear All,
    Can anyone explain the usage of Functional Area when we Config the Financial Statement.
    Regards,
    Kris

    Hello
    Please check this out and assign points if useful
    Definition
    Account assignment characteristic that sorts operating expenses according to functions, for example:
    Production
    Administration
    Sales
    Research and development
    Use
    If you want to use cost of sales accounting, you have to use functional areas to sort your operating expenses.
    You define your functional areas in Customizing under Financial Accounting ® Financial Accounting Global Settings ® Company code® Cost of Sales Accounting ® Define Functional Area.
    Use
    You can enter the functional area in the master data of the following objects:
    G/L account
    Cost element
    Cost center
    Orders
    Order type
    Internal orders
    Sales order for make-to-order production and requirements class
    Maintenance, service, and QM order
    Production order, product cost controller, and cost object hierarchy
    WBS elements
    Project profile and project definition
    WBS element
    Networks
    Network type
    Network header
    Network activity
    During posting, the system derives the functional area from the master data of the assigned objects. For more information, see  Derivation of the Functional Area.
    Prerequisites
    In order to be able to enter the functional area in the master data of the specified objects, the Functional area field in master data has to be ready for input. For this to be the case, cost of sales accounting for your company codes must either be active for preparation or active.
    You make the settings in Customizing under Financial Accounting ® Financial Accounting Global Settings ® Company Code ® Cost of Sales Accounting ® Activate Cost of Sales Accounting for Preparation or Activate Cost of Sales Accounting.
    The master data of some objects is not company code dependent, rather it is assigned to higher-level organizational units. In such cases, the functional area field is ready for input in all company codes of a client, provided that cost of sales accounting is active for preparation or active for at least one company code of the client.
    In the following cases, the master data of an object is not company code-dependent:
    Object
    Assigned organizational unit
    G/L account
    Chart of accounts
    Cost element
    Chart of accounts
    Cost center category
    Client
    Order type
    Client
    Features
    You have the following options for entry of functional area in the master data of the specified objects:
    Entry of functional area
    You can enter the functional area provided that no postings exist for this object.
    Change functional area
    You can change a functional area that has already been entered as long as no postings exist.
    Where postings already exist, it is no longer possible to change the functional area.
    Postings that have already been made cannot be changed automatically. The functional area is derived only in the case of new postings.
    Where it is absolutely necessary to change the functional area for existing postings, you can find instructions on how to perform the change in Note 115840.

  • If statement in calculated batch characteristic (dependencies)

    I have a little problem with calculating a certain batch characteristic.
    The situation is the following:
    I have batch char A, batch char B and batch char C. Batch char C is the result of the sommation of char A and B. The problem I have now is that batch char C only should be calculated when batch char A and B are different from 0.
    I have a custom build interface that imports QM data to the batch chars. Default, all my batch chars are set to 0 so if I just say $self.charC = $self.charA + $self.charB, I always get a value.
    Is it possible to some sort of IF statement to check if the value is different from 0?

    Dear,
    You need to try with variant table
    take all the combination and enter in a variant table and see the result...it works
    example
    A     B      C
    0      0      space
    0      1      sapce
    1      1      space
    I hope you got it

  • Travel Expense Type- Not coming correctly in HTML Form

    I am using HTML forms in travel management. When I simulate a travel expense statement, in the sections
    I T E M I Z A T I O N
    Additional Information for Itemization
    the name of the travel expense type come as truncated. It takes only 15 characters, while actually it can be 30.
    Any solution how it can be increased?

    Solved

  • Create "dynamic" statements in a stored procedure

    hello
    in my stored procedure I need to write a statement like this:
    FUNCTION myfunct (mytable IN VARCHAR2)
    BEGIN
    EXECUTE IMMEDIATE
    'SELECT COUNT(*)
    INTO myvar
    FROM ' || mytable ||
    'WHERE mycol = ' || currval;
    In short I need to create a sort of "dynamic" statement in which the tablename (nad other...) is a variable....
    but I do not guess it's ok...
    How can I do?

    Hi,
    With dyanmic SQL, the INTO clause is part of the EXECUTE IMMEDIATE statement, not the query.
    Try something like this:
    CREATE OR REPLACE FUNCTION     myfunct
    (       mytable       IN     VARCHAR2
    RETURN     PLS_INTEGER
    IS
         return_num     PLS_INTEGER;
         sql_txt          VARCHAR2 (1000);
    BEGIN
         sql_txt := 'SELECT  COUNT (*)'
              || ' FROM ' || mytable;
         dbms_output.put_line (sql_txt || ' = sql_txt in myfunct');
    --     EXECUTE IMMEDIATE sql_txt INTO return_num;
         RETURN     return_num;
    END     myfunct
    /It's a good idea to develop dynamic SQL as shown above; putting the dynamic statement into a variable that can easily be displayed for debugging.
    When it looks right, then un-comment the EXECUTE IMMEDAITE statement.
    Before moving the code into Production, comment out (or remove) the put_line statement.

Maybe you are looking for

  • How can I get BT to remove the DACS on my phone li...

    I spent nearly two years trying to get Talk Talk to sort out braodband with no joy so I decided to move to BT in the vain hope that they may have more chance of sorting out the problem.  When speaking to an adviser they said there is a DACs on my pho

  • Error IW351-------System: Status object does not exist

    Hello, I am getting bleow error while saving service order. System: Status object does not exist. Message Numner IW351 Actually I have done one enhcement in the User exit of the Sales order in the form Routine... USEREXIT_SAVE_DOCUMENT_PREPARE  in MV

  • Problem with HP Envy 15-j009 WM

    I have a problem with my laptop HP Envy 15-j009wm buy it a few days ago and randomly conjelada stays. When conjela I have to turn it off forcefully. Realize you already extensive test and passes all but the problems persist.

  • Result Set - How to retrieve the number of rows in resultset

    harlo....everyone. i m new in this language and would like to ask that how can i store the result into an array or u all hav others ideal to do it......? Hopefully can get answer asap....thanksssss. Below is the source code that i did. Please comment

  • JVC everio GZ-HD7

    is the JVC everio GZ-HD7 compatible with fcp?