<?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: Inner join Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558926#M1268582</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;you can select fields using syntax like a~erdat. So you need to write down all fields which you need from your query instead of using *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2009 02:38:12 GMT</pubDate>
    <dc:creator>mvoros</dc:creator>
    <dc:date>2009-05-20T02:38:12Z</dc:date>
    <item>
      <title>Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558921#M1268577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this inner Join Statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT *&lt;/P&gt;&lt;P&gt;      FROM vbap AS a INNER JOIN vbak AS b&lt;/P&gt;&lt;P&gt;                     ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;                     AND a&lt;SUB&gt;mandt = b&lt;/SUB&gt;mandt&lt;/P&gt;&lt;P&gt;      WHERE a~vbeln IN lr_vbeln AND&lt;/P&gt;&lt;P&gt;            a~posnr IN lr_posnr AND&lt;/P&gt;&lt;P&gt;            a~aedat IN lr_aedat AND&lt;/P&gt;&lt;P&gt;          ( b~vbtyp EQ 'A' OR&lt;/P&gt;&lt;P&gt;            b~vbtyp EQ 'B' OR&lt;/P&gt;&lt;P&gt;            b~vbtyp EQ 'G' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i see the Output, One of the field ERDAT is geeting picked up from VBAK table instead of VBAP table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any pointers on how can we select the ERDAT from VBAP using this inner Join.&lt;/P&gt;&lt;P&gt;I dont want to use 2 select stetements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mayank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 17:43:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558921#M1268577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T17:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558922#M1268578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mayank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this way..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : it_vbap type standard table of vbap with header line.  "add this

       SELECT *
       FROM vbap AS a INNER JOIN vbak AS b
                      ON a~vbeln = b~vbeln
                      AND a~mandt = b~mandt
      into corresponding field of it_vbap "add this
       WHERE a~vbeln IN lr_vbeln AND
             a~posnr IN lr_posnr AND
             a~aedat IN lr_aedat AND
            b~vbtyp in ( 'A' , 'B' , 'G' ).      "add this
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 17:51:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558922#M1268578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T17:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558923#M1268579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post the actual statement that you are using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 18:07:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558923#M1268579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T18:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558924#M1268580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prabhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Code which you have provided will not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other inputs on this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 23:02:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558924#M1268580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T23:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558925#M1268581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mayank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What ouput are you seeing in the above statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can directly use VBAP-ERDAT or VBAK-ERDAT, as the data will be stored in the header line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 23:38:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558925#M1268581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T23:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558926#M1268582</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;you can select fields using syntax like a~erdat. So you need to write down all fields which you need from your query instead of using *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 02:38:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558926#M1268582</guid>
      <dc:creator>mvoros</dc:creator>
      <dc:date>2009-05-20T02:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558927#M1268583</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;During inner joins using Alias ('A' or 'B' and so on), we have to instruct, &lt;STRONG&gt;&lt;U&gt;what field from which Alias need to be selected from the Query&lt;/U&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RamaniN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 03:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558927#M1268583</guid>
      <dc:creator>former_member229729</dc:creator>
      <dc:date>2009-05-20T03:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558928#M1268584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Inner join, it is always advisable to put the header table as First table and secondly, it should be advisable to fetch only the requried fields. I believe that you might not required all the fields of VBAP table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select A~Vbeln
          A~vbtyp
          B~posnr
          B~erdat
          into table I_VBAP
          from vbak as A innner Join VBAP as B
          on  a~vbeln = b~vbeln
          where   a~vbeln IN lr_vbeln AND
                      b~posnr IN lr_posnr AND
                      b~aedat IN lr_aedat AND
                     ( a~vbtyp EQ 'A' OR
                       a~vbtyp EQ 'B' OR
                       a~vbtyp EQ 'G' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 04:08:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558928#M1268584</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T04:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558929#M1268585</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;please use &lt;STRONG&gt;into corresponding fields&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into corresponding fields of table &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;from ( VBAK AS A INNER JOIN VBAP AS B  ON &lt;/P&gt;&lt;P&gt;A&lt;SUB&gt;VBELN  = B&lt;/SUB&gt;VBELN  )&lt;/P&gt;&lt;P&gt;WHERE a~vbeln IN lr_vbeln AND&lt;/P&gt;&lt;P&gt;                      b~posnr IN lr_posnr AND&lt;/P&gt;&lt;P&gt;                      b~aedat IN lr_aedat AND&lt;/P&gt;&lt;P&gt;                     ( a~vbtyp EQ 'A' OR&lt;/P&gt;&lt;P&gt;                       a~vbtyp EQ 'B' OR&lt;/P&gt;&lt;P&gt;                       a~vbtyp EQ 'G' ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 09:59:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558929#M1268585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T09:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558930#M1268586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;done&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 17:39:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-statement/m-p/5558930#M1268586</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T17:39:39Z</dc:date>
    </item>
  </channel>
</rss>

