[9303] in SAPr3-news

home help back first fref pref prev next nref lref last post

Re: Join - Syntax

daemon@ATHENA.MIT.EDU (St|tz Richard)
Fri Dec 18 11:27:50 1998

To: sapr3-news@MIT.EDU
Date: Fri, 18 Dec 1998 17:26:49 +0100
From: "St|tz Richard" <str@telekabel.at>


Here is a example from my newest creation with version 40B:

SELECT VBAK~VBELN
       VBAK~KNUMV
       VBAK~WAERK
       VBPA~PARVW
       VBPA~KUNNR
       VEDA~VENDDAT
    INTO CORRESPONDING FIELDS OF TABLE IT_SORT
    FROM VBAK
      INNER JOIN VBPA
        ON VBAK~VBELN = VBPA~VBELN
      INNER JOIN VEDA
        ON VBPA~VBELN = VEDA~VBELN
    WHERE (    (    VBAK~WAERK = WP_HAUSW )
           AND (    VBPA~POSNR  = 0
                AND VBPA~PARVW  = 'RG'
                AND VBPA~KUNNR  IN WO_KUNNR )
            AND (    VEDA~VPOSN   = 0
                 AND VEDA~VENDDAT = 0 ) ).


For the best enjoying of this command it would be the best to copy it by
clipboard to a editor with a fixed space font.
General ist better to select field by field in the select statement and not
"select *", but in a large join with 3 or more tables, you shouldn't ever
thing about it (I am not ever sure that ABAP let you do this).
The benefit when you work with field selection than with "select *" is with
my experience about 50% (or in words: double speed) related to the whole
time which the report take (handstopped).
The using of an alias name is in my opinion absolutely unnecessary and just
a way to confuse the next programmer who have to service this.

regards

STR


May SAP be with you and your users - Sap Sap

Who find spelling mistakes can keep it.


K. Ganapathy schrieb in Nachricht <367697FE.48608BCF@synopsys.com>...
>Could someone post the syntax for
>'inner join' and 'outer join' in the 'where' clause.
>Specifically, those involving more than 2 tables.
>
>Thanks.
>
>K. Ganapathy.









home help back first fref pref prev next nref lref last post