What is the difference between this 2 programms?

     Hello guys, i just started learning ABAP so i made this 2 programms which are displaying information from the sflight table after asking for a
parameter. The both achieve the same task, but there must be a difference. Maybe in performance? Thanks verry much.
                                                                                            Program nr.1 :
              REPORT  ZTABLE7.
                 types: BEGIN OF ZPFLI_STRUCTURE,
                                     carrid TYPE  spfli-carrid,
                                     cityfrom type spfli-cityfrom.
                 types end of ZPFLI_STRUCTURE.
                 data: lt_join type table of ZPFLI_STRUCTURE,
                                                wa_join like line of lt_join.
                 parameters: p_par type ZPFLI_STRUCTURE-CARRID.
                select * from spfli into corresponding fields of table lt_join.
                                       loop at lt_join into wa_join.
                                                                 new-line.
                                           if p_par = wa_join-carrid.
                                                                   write:
                                                     wa_join-cityfrom.
                                       endif.
                                       endloop.
                                                                                            Program nr.2:
                                            REPORT  ZTABLE
                parameters p_carrid type sflight-carrid.
                data fly type spfli.
              select * from spfli into fly
              where carrid = p_carrid.
              new-line.
              write: fly-cityfrom, fly-cityto.
              endselect.

Exactly, the big difference between these code is the performance, in the first one you are selecting all records of table (this obviously is a really bad behavior ) and after you've created a logic to find out which record of internal table the program is going to show for user..
The second, you're selecting using a clausule where and passing an especific value.
If you want to analise this before you transport to production enviroment, using transactions like ST12, SE30, ST05 or STAD and if you want to learn more about, search for the topic openSQL.
Regards,
Janderson Livio

Similar Messages

  • What's the difference between this and super in this class

    public interface Doggie {
    public void wao();
    public void fetchBall();
    public void run();
    public void sleep();
    public class Kittie {
    public void miao() {
    public void catchRat() {}
    public void run() {}
    public void sleep() {}
    public class KtoD extends Kittie implements Doggie {
    public void wao() {
    this.miao();//here super.miao() will work too,
    //what is the difference between them?
    public void fetchBall() {
    this.catchRat();//here too
    public void run() {
    super.run();
    public void sleep() {
    super.sleep();
    }

    well, just off the top of my head (someone who wants to quote the relevant parts of the JLS can reply here too) - this makes sense, because your KtoD class extends Kittie, which has a miao method. You've not overridden this method, so KtoD's miao method is Kittie's method. Thus, this.miao() and super.miao() refer to the same method. If you had overridden this method in your KtoD class then this.miao() would refer to the overridden miao method, and if you had wanted to call the miao method from Kittie then you would have had to use super.miao()
    Did that answer your question?
    Lee

  • What are the differences between this two statements???

    1.select * from counter where eboxid = (select acctid from zsyy_ocecs.cm_subs_subscriber where servnumber = ?);
    2.select b.* from zsyy_ocecs.CM_SUBS_SUBSCRIBER a,COUNTER b where a.acctid = b.eboxid and a.servnumber = ?;
    what are the differences between the 2 sql statements??
    I WILL APPRECIATE FOR YOUR ANSWERS VERY MUCH, BECAUSE I WAS PUZZLED WHEN I SAW THE EXECUTION PLANS.THANKS AGAIN. MR SHI.
    the followings are their execute plans:
    Command> select * from counter where eboxid = (select acctid from zsyy_ocecs.cm_subs_subscriber where servnumber = ?);
    Query Optimizer Plan:
    STEP: 1
    LEVEL: 2
    OPERATION: TblLkTtreeScan
    TBLNAME: ZSYY_OCECS.CM_SUBS_SUBSCRIBER
    IXNAME: IDX_SERVNUM
    INDEXED CONDITION: CM_SUBS_SUBSCRIBER.SERVNUMBER = qmark_1
    NOT INDEXED: ROWNUM < 3
    STEP: 2
    LEVEL: 2
    OPERATION: RowLkTtreeScan
    TBLNAME: COUNTER
    IXNAME: IDX_COUNTER
    INDEXED CONDITION:
    COUNTER.EBOXID = CM_SUBS_SUBSCRIBER.ACCTID
    NOT INDEXED: <NULL>
    STEP: 3
    LEVEL: 1
    OPERATION: NestedLoop
    TBLNAME: <NULL>
    IXNAME: <NULL>
    INDEXED CONDITION: <NULL>
    NOT INDEXED: <NULL>
    Command> select b.* from zsyy_ocecs.CM_SUBS_SUBSCRIBER a,COUNTER b where a.acctid = b.eboxid and a.servnumber = ?;
    Query Optimizer Plan:
    STEP: 1
    LEVEL: 2
    OPERATION: TmpTtreeScan
    TBLNAME: ZSYY_OCECS.CM_SUBS_SUBSCRIBER
    IXNAME: <NULL>
    INDEXED CONDITION: <NULL>
    NOT INDEXED: A.SERVNUMBER = qmark_1
    STEP: 2
    LEVEL: 2
    OPERATION: TblLkTtreeScan
    TBLNAME: COUNTER
    IXNAME: IDX_COUNTER
    INDEXED CONDITION: B.EBOXID
    = A.ACCTIDNOT INDEXED: <NULL>
    STEP: 3
    LEVEL: 1
    OPERATION: MergeJoin
    TBLNAME: <NULL>
    IXNAME: <NULL>
    INDEXED CONDITION: A.ACCTID = B.EBOXID
    NOT INDEXED: <NULL>
    Edited by: user9533799 on 2008-9-3 上午1:28

    If zsyy_ocecs.cm_subs_subscriber table returns one row for each servnumber, both statements would return the same data. But if there was a servnumber value on two rows, the first statement will throw an error (you a comparing a value with a set of values). You can rewrite the first query to avoid this:
    select * from counter where eboxid in (select acctid from zsyy_ocecs.cm_subs_subscriber where servnumber = ?);
    Conceptually they are different and the execution plan can't be the same.

  • What's the difference between this and Acrobat 7.0 Pro?

    I don't understand what the difference is between this product and Acrobat 7.0.5 Professional... I can view 3d enabled PDFs in 7.0.5 Pro.
    Is this tool a superset of Acrobat 7 Pro that facilitates creation of this 3D content?

    Actually, the Mac story is a bit more complicated than has been reported. The Acrobat 3D (authoring) product is currently available only on Windows. The new Adobe Reader 7.0.7, which contains the enhanced 3D viewing and collaboration features mentioned in the press releases, will be available simultaneously on Windows AND Mac. The Unix ports mentioned are only for capturing OpenGL streams from applications on Unix and creating PDFs from them, the entire functionality of Acrobat 3D is not currently available on Unix.
    I cannot comment on if and when a Mac version of the authoring tool (Acrobat 3D) would be released. Content produced on Windows, however, will be viewable on the Mac and can be collaborated on on the Mac exactly as on Windows, using the Adobe Reader. A lot of work was done on the Mac to make this happen.
    As far as OpenGL Capture, you can theoretically capture any output that displays using OpenGL on Windows or the Unix systems that Acrobat 3D supports. However, that said, we sometimes run into applications that do not capture properly. We tested with a number of important CAD applications so that we could make sure that capture worked from them, but we were, obviously, unable to test capture with all OpenGL applications. If you find one that does not work, please report it as a bug against the product.
    Hope this helps.
    Michael Kaplan
    Director of Engineering, Acrobat 3D/Manufacturing

  • I use firefox 3.6.1 on a mac os 10.5.8. What is the difference between this and firefox 6?

    As I mentioned, I am running 3.6.1 and am when I go to the firefox website I get the message that I am using an old version and am asked to update to the latest which appears to be 6.0. Is this an update to 3.6.1? When researching on the web, I see that 6 is an update to version 5. So, is the update for me or is it a different version altogether?
    Thanks

    Yes, 6.0 is an update for 3.6.1. The 3.6.x versions were followed by 4.0 in March 2011, then 5.0 in June which was an update for 4.0, and 6.0 an update for 5.0 in August.
    Mozilla moved Firefox to a fast release system this past spring, quicker releases with fewer changes per release. Instead of users having to wait for a new feature to be added in 10 to 14 months under the old release system, a new feature is added to a release like 12 weeks after the new feature is deemed to be complete and ready for release.

  • What is the difference between Aspect Ratios?

    Hello. I couldn't find any specific documentation regarding this.
    I am working on an iPhoto 09 slideshow project using the scrapbook theme. I am planning to export the slideshow as a movie (it looks like the default export is mpeg 4 but I could also export as a quicktime .mov) and then move to iDVD to burn on a DVD. Ultimately, I need to show it on a projector using a DVD player. I'm not sure what the projector's resolution is but I assume 16:9 will be the best aspect ratio for the highest quality.
    In the slideshow settings, there are 4 different aspect ratios:
    1) This Screen (16:9)
    2) HDTV (16:9)
    3) TV (4:3)
    4) iPhone (3:2)
    What is the difference between This Screen (1) and HDTV (1)? Does it matter? Any other suggestions?
    Thanks.

    Terence Devlin wrote:
    Aspect ratio is the ratio of the width to the height of the image - in other words it's about shape. So both the 'This Screen' and the 'HDTV' settings will be the same Aspect Ratio.
    The Aspect Ratio has no bearing on the quality, only the shape of the final images.
    TD is absolutely correct here. The aspect ratio is only the shape of the image, not the quality. Basically, you need to decide if you are designing the show for viewing on a HD tv (16:9 or widescreen) or a SD tv (4:3 or squarish). A couple of years ago this choice was easy since most tv's out there were still 4:3, but today, the opposite is true. The popular choice now would be 16:9.
    The biggest problem you will have with the quality of your slideshow is the
    fact that you're burning it to DVD.
    Your slideshow will be heavily compressed to fit the DVD spec of 640 x 480
    pixels and this can lead to soft images or even blurry ones.
    I think we're getting "compression" and "resolution" confused here a bit, or at the very least, we're using the wrong terminology.
    For everyone's benefit, let me try to explain...
    If you show an image that is native 640x480 on a screen that is native 640x480 (standard def tv screen), the image will look just fine. This is resolution and will not effect quality as long as you don't try to view at a higher resolution than the image actually is.
    (If you try to view a 640x480 slide show in full screen mode on your computer monitor which is running at 1280x1024, the image will look horrible.)
    Trying to view a higher rez image (ie: 3200x2400) on a lower resolution (ie 640x480 or SD tv) screen will reap NO benefit in quality. Remember that a SD TV will only show 640x480 (or 720x480) and no higher, so there is no benefit in trying to cram more pixels into an image than the screen can actually show.
    Of course this all changes if you're going to view it on today's HiDef tvs, but even on them, the resolution tops at at 1920x1080. Once again, using a very high def image (ie: 3840x2160) will reap NO benefit since the resolution of the screen it's being viewed on tops out at 1920x1080. The aspect ratio on this type of tv is now 16:9 so the images shape will be wider than a normal tv (4:3).
    Compression is the scheme used to compress an image to reduce it's file size, thus reducing it's quality. JPEG is a common form of image compression, and the amount of compression can be adjusted..the more compression, the more degradation of quality. This has nothing to do with resolution.
    Depending on how you're going to process (iPhoto, iMovie, iDVD), the program will reduce the resolution of the original image to the resolution of you output. In other words, don't worry about doing any kind of resolution change prior to creating the dvd, as the program you choose to use will simply lower the resolution (this is not compression) to fit the output you choose.
    Message was edited by: Rufus
    Message was edited by: Rufus
    Message was edited by: Rufus

  • What is the difference between these two sites.

    What is the difference between (this site) Apple Support Communities and the Developer forum.
    When I search on "apple developers forum"  what is the difference between the first and the seconde hit.
    RL6001

    RL6001 wrote:
    What is the difference between (this site) Apple Support Communities and the Developer forum.
    Aside from any other benefits of the paid developer programs, the Developer forums are focused solely on developers. This forums is just one little out-of-the-way corner of a much larger, more consumer oriented discussion site. Questions asked in the Developer forums are typically more difficult and may take several days to get an answer. Questions here are more beginner-type questions and you will get an answer much more quickly. The Developer forums are mostly populated by professional developers who have a much different perspective than you get on most other public internet forums. If you don't know what I'm talking about then you probably wouldn't believe me anyway.

  • What's the difference between these two modes?

    Hello there!!!
    As you all know, in the deco tool there are three differences modes:
    1. The Symmetry Brush effect mode.
    2. The Grid Fill effect mode.
    3. And the Vine Fill effect mode.
    Inside the Symmetry Brush effect mode, in its advanced options, there is one option named 'Grid Translation', which allow you to create a grid effect from a selected symbol, so I simply wonder what's the difference between this advanced option of the Symmetry Brush effect to the 'Grid Fill effect mode' that also enable you to do just the same thing!!!!
    Everybody who think that he found one or more differences between the mentioned above modes, is invited to post his opinions here.

    In analog terms, to explain YCbCr use the example of the COMPONENT output from your DVD player. It use 3 separate cables (Y = Luminance = Green Cable), (Y-B = Blue Color Diff = BLUE Cable) and (Y-R = Red Color Diff = RED Cable). In the analog world, RGB is actually RGBHV (5-wire) and is adaptable to 15-pin VGA with a simple passive adapter. Many people will mistakenly refer to Analog Component video as RGB, since the cables are Red, Green and Blue.
    So, since all that mumbo jumbo means essentially the same, this appears to be the digital "equivalent" of what is known as Component Video in the Analog world... What I said about RGBHV does not apply to the 10-bit color, but thought I'd mention it anyway.
    -BChil

  • What's the difference between String() - as String - toString();

    Hello,
    I'm wondering what's the difference between this 3 ways of getting around.

    There is a great difference between String(), as String and toString() methods.
    String(param) -- the more general and safe method.
    Returns "null" (string!) if param is null;
    Returns result of param.toString() method if it is defined in class;
    Returns string representation of the param (returns "[object Object]" if param is Object);
    param asString --
    Returns string if param is a type of String;
    Returns null otherway (if param is custom class, int or other type);
    param.toString() -- call of toString() member function
    throws an exception if param is null;
    compile-time error if toString() method is not defined in param (if your custom class do not have or inherits this function);
    returns result of toString() function
    Exists also ""+param and param+"" ways. They are similar to ""+String(param) and String(param)+""
    Pay attention:
    var ss:String = null;
    trace(String(ss)==(ss as String)); // Returns false as "null" not equal to null

  • What are the differences between Sun Certified Programmer for Java 2 Platfo

    Hi
    What are the differences between Sun Certified Web Component Developer for the Java 2 Platform, Enterprise Edition 1.4 (CX-310-081) and 5 (CX-310-083) exams?
    What has been removed from the new web component developer 5 exam?
    What has been added to the new web component developer 5 exam?
    Thanks in Advance

    what (apart from laziness) is preventing you from looking up the information for yourself?

  • What is the differents between subroutine

    what is  the differents between subroutine and function module
               plz explain cliarly

    Hi,
    ABAP contains the following kinds of procedures:
    Subroutines
    Subroutines are principally for local modularization, that is, they are generally called from the program in which they are defined. You can use subroutines to write functions that are used repeatedly within a program. You can define subroutines in any ABAP program.
    Function Modules
    Function modules are for global modularization, that is, they are always called from a different program. Function modules contain functions that are used in the same form by many different programs. They are important in the R/3 System for encapsulating processing logic and making it reusable. Function modules must be defined in a function group, and can be called from any program.
    Methods
    Methods describe the functions and behavior of classes and their instances in ABAP Objects. Methods must be defined in classes. When you call them, you must observe certain special rules of object-oriented programming.
    A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
    FORM <subr> [USING   ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]
                [CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ].
    ENDFORM.
    Function Modules
    Function modules are procedures that are defined in function groups (special ABAP programs with type F) and can be called from any ABAP program. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.
    Function modules allow you to encapsulate and reuse global functions in the R/3 System. They are stored in a central library. The R/3 System contains a wide range of predefined function modules that you can call from any ABAP program. Function modules also play an important role in database updates and in remote communications between R/3 Systems or between an R/3 System and a non-SAP system.
    Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.
    The Function Builder also has a release process for function modules. This ensures that incompatible changes cannot be made to any function modules that have already been released. This applies particularly to the interface. Programs that use a released function module will not cease to work if the function module is changed.

  • What is the difference between Topic Keywords and Index File Keywords?

    What is the difference between Topic Keywords and Index File Keywords? Any advantages to using one over the other? Do they appear differently in the generated index?
    RH9.0.2.271
    I'm using Webhelp

    Hi there
    When you create a RoboHelp project you end up with many different ancillary files that are used to store different bits of information. Many of these files bear the name you assigned to the project at the time you created it. The index file has the project name and it ends with a .HHK file extension. (HHK meaning HTML Help Keywords)
    Generally, unless you change RoboHelp's settings, you add keywords to this file and associate topics to the keywords via the Index pod. At the time you compile a CHM or generate other types of output, the file is consulted and the index is built.
    As I said earlier, the default is to add keywords to the Index file until you configure RoboHelp to add the keywords to the topics themselves. Once you change this, any keyword added will become a META tag in the topic code. If your keyword is BOFFO, the META tag would look like this:
    <meta name="MS-HKWD" content="BOFFO" />
    When the help is compiled or generated, the Index (.HHK) file is consulted as normal, but any topics containing keywords added in this manner are also added to the Index you end up with. From the appearance perspective, the end user woudn't know the difference or be able to tell. Heck, if all you ever did was interact with the Index pod, you, as an author wouldn't know either. Well, other than the fact that the icons appear differently.
    Operationally, keywords added to the topics themselves may hold an advantage in that if you were to import these topics into other projects, the Index keywords would already be present.
    Hopefully this helps... Rick

  • What is the difference between 'command delete' and using 'delete original and all versions'?

    My masters are not referenced and I usually have only one version.  What is the difference between using 'command delete' versus going to the top menu bar and using 'dele

    Good question  .
    When the Version is the only Version based on the Original of that Version, the two commands have the same effect.
    See this User Tip by master Aperturist Frank Caggiano.

  • What is the difference between Video-out and mirroring?

    What is the difference between Video-out and mirroring? I can't get iPhone 4 video to work on my TV screen
    I have just bought an MD098ZM/A (Apple 30-pin Digital AV Adapter). I am struggling to get it to show a picture on my TV. I know I'm doing something right because the audio is coming out of my TV speakers but no picture on the TV screen.
    I have used the same HDMI channel (on the TV side) with the same cable and my thunderbolt port (MacBook Air) without any trouble - and on the same app (BBC iPlayer download then full-screen mode).
    Now I note that the packaging for the MD098ZM/A says video-out on iPhone 4 but mirroring only on iPhone 4S. I only have an iPhone 4 (not the 4S). Now if the lack of iPhone 4 support for mirroring means that I can't play video material out to my TV, then in what sense is there any video-out capability at all?
    There is only safety and warranty paperwork in the Apple adapter packaging - no help information. And I haven't found further guidance online either.
    I do note somewhere online that it suggests that basic non-mirroring video-out (for this adapter) only works with some external TV sets. Any way of finding out which? I'm using a Sanyo CE32LD90-B LCD TV if it helps.
    So far not doing very well.

    Now found these but have had to give up on this adapter!
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    http://support.apple.com/kb/HT4108

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

Maybe you are looking for