<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: reg: join statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801039#M914136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would you analyse a join:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RSEG&lt;/P&gt;&lt;P&gt;Not buffered, size 3, 2 indexes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Primary key &lt;/P&gt;&lt;P&gt;MANDT	&lt;/P&gt;&lt;P&gt;BELNR	&lt;/P&gt;&lt;P&gt;GJAHR	&lt;/P&gt;&lt;P&gt;BUZEI	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index AD&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;EBELN&lt;/P&gt;&lt;P&gt;EBELP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EKPO&lt;/P&gt;&lt;P&gt;Not buffered, size 3, lots of indexes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Primary key &lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;EBELN&lt;/P&gt;&lt;P&gt;EBELP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where condition: belnr and gjahr from FOR ALL ENTRIES table,&lt;/P&gt;&lt;P&gt;Obviously good part of primary key of RSEG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON Condition is the primary key of EKPO: EBELN and EBELP are unique and therefore sufficient, additional fields are not necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt;	join is rather simple to built&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF not (tbl_cross is initial ).
  SELECT a~belnr a~gjahr a~buzei a~ebeln a~ebelp a~bukrs
         a~werks a~wrbtr a~mwskz b~matkl
         INTO TABLE tbl_rseg_ekpo
         FROM   rseg AS a
           JOIN ekpo AS b
           ON   a~ebeln = b~ebeln
           AND a~ebelp = b~ebelp
         FOR ALL ENTRIES IN tbl_cross
         WHERE a~belnr = tbl_cross-awkey
         AND   a~gjahr = tbl_cross-gjahr.
Endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FOR ALL ENTRIES table can have up to several 10.000 entries if necessary. It is anyways processed in small blocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2008 07:54:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-16T07:54:20Z</dc:date>
    <item>
      <title>reg: join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801036#M914133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  SELECT a&lt;SUB&gt;belnr a&lt;/SUB&gt;gjahr a&lt;SUB&gt;buzei a&lt;/SUB&gt;ebeln a&lt;SUB&gt;ebelp a&lt;/SUB&gt;bukrs a~werks&lt;/P&gt;&lt;P&gt;           a&lt;SUB&gt;wrbtr a&lt;/SUB&gt;mwskz&lt;/P&gt;&lt;P&gt;           b~matkl&lt;/P&gt;&lt;P&gt;      FROM rseg AS a&lt;/P&gt;&lt;P&gt;      JOIN ekpo AS b&lt;/P&gt;&lt;P&gt;        ON a&lt;SUB&gt;ebeln = b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;       AND a&lt;SUB&gt;ebelp = b&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;       AND a&lt;SUB&gt;bukrs = b&lt;/SUB&gt;bukrs&lt;/P&gt;&lt;P&gt;       AND a&lt;SUB&gt;werks = b&lt;/SUB&gt;werks&lt;/P&gt;&lt;P&gt;      INTO TABLE tbl_rseg_ekpo&lt;/P&gt;&lt;P&gt;       FOR ALL ENTRIES IN tbl_cross&lt;/P&gt;&lt;P&gt;     WHERE  belnr = tbl_cross-awkey&lt;/P&gt;&lt;P&gt;        AND gjahr = tbl_cross-gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Is it good join statement or not ?&lt;/P&gt;&lt;P&gt; Why Iam doubt is in RSEG ebeln, ebelp are not the key fields&lt;/P&gt;&lt;P&gt; which are key fields in ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give ur suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 10:01:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801036#M914133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T10:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: reg: join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801037#M914134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put a break point in this select ( in ur program) use ST05, and see the details in Explain section. From this you can come to know it is a problematic select or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;madhumitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 10:25:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801037#M914134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T10:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: reg: join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801038#M914135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your doubt looks like a good option because you are accessing RESB with it's key belnr (it's the left table). And then, with the record found, it's goes to EKPO with it's key too ... so it's ok in that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, as have been said, use ST05 to measure the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My doubt is always FOR ALL ENTRIES ... remenber that if the internal table is too big, you must split it in more than one parts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regasrds.&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 17:52:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801038#M914135</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-05-15T17:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: reg: join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801039#M914136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would you analyse a join:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RSEG&lt;/P&gt;&lt;P&gt;Not buffered, size 3, 2 indexes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Primary key &lt;/P&gt;&lt;P&gt;MANDT	&lt;/P&gt;&lt;P&gt;BELNR	&lt;/P&gt;&lt;P&gt;GJAHR	&lt;/P&gt;&lt;P&gt;BUZEI	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index AD&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;EBELN&lt;/P&gt;&lt;P&gt;EBELP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EKPO&lt;/P&gt;&lt;P&gt;Not buffered, size 3, lots of indexes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Primary key &lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;EBELN&lt;/P&gt;&lt;P&gt;EBELP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where condition: belnr and gjahr from FOR ALL ENTRIES table,&lt;/P&gt;&lt;P&gt;Obviously good part of primary key of RSEG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON Condition is the primary key of EKPO: EBELN and EBELP are unique and therefore sufficient, additional fields are not necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt;	join is rather simple to built&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF not (tbl_cross is initial ).
  SELECT a~belnr a~gjahr a~buzei a~ebeln a~ebelp a~bukrs
         a~werks a~wrbtr a~mwskz b~matkl
         INTO TABLE tbl_rseg_ekpo
         FROM   rseg AS a
           JOIN ekpo AS b
           ON   a~ebeln = b~ebeln
           AND a~ebelp = b~ebelp
         FOR ALL ENTRIES IN tbl_cross
         WHERE a~belnr = tbl_cross-awkey
         AND   a~gjahr = tbl_cross-gjahr.
Endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FOR ALL ENTRIES table can have up to several 10.000 entries if necessary. It is anyways processed in small blocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 07:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-join-statement/m-p/3801039#M914136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T07:54:20Z</dc:date>
    </item>
  </channel>
</rss>

