<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904487#M1145202</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;select a~budat a~belnr 
b~bukrs b~hkont b~gsber b~shkzg b~dmbtr into 
(itab-budat,itab-belnr,itab-bukrs,itab-hkont,itab-gsber,itab-shkzg,
tdmbtr) 
from bkpf as a inner join  bseg as b on a~belnr = b~belnr
where budat between  budat-low and budat-high and bukrs in bukrs and 
bukrs in bukrs and hkont in hkont and gsber in gsber.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im doing like this m i syntactically right..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Dec 2008 10:04:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-23T10:04:24Z</dc:date>
    <item>
      <title>inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904481#M1145196</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;can any one plz teel me how to write the inner join for this query..? im trying but its giving me errors..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select budat belnr into (itab-budat,itab-belnr) from bkpf
where bukrs in bukrs and budat between  budat-low and budat-high .


 select bukrs hkont gsber shkzg dmbtr into (itab-bukrs,itab-hkont,
 itab-gsber,itab-shkzg,itab-dmbtr) from bseg
 where bukrs in bukrs and hkont in hkont and gsber in gsber
 and belnr = itab-belnr.


 if sy-subrc = 0.

   append itab.
   clear itab.

 endif.

 endselect.
endselect.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;LOCKED BY MODERATOR - USE APPROPRIATE TITLES&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Dec 23, 2008 10:31 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 09:34:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904481#M1145196</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T09:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904482#M1145197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BSEG is a cluster table . You cannot have a join on it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 09:40:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904482#M1145197</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T09:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904483#M1145198</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;Sorry...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: avinash kodarapu on Dec 23, 2008 3:15 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 09:44:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904483#M1145198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T09:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904484#M1145199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so what is an alternative which and what kind of join on which table can be applied..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 09:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904484#M1145199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T09:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904485#M1145200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nilesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As mentioned by Ankesh, You can't use cluster or pool tables as your join tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the example JOINS. Use this on non cluster or pool tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT s~carrid s~carrname p~connid 
       INTO CORRESPONDING FIELDS OF TABLE itab 
       FROM scarr AS s 
       INNER JOIN spfli AS p ON s~carrid   =  p~carrid 
                                  AND p~cityfrom = p_cityfr. 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you cannot perfor JOINS then use FOR ALL ENTRIES. Please check the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT BUDAT BELNR
  FROM BKPF
  INTO TABLE IT_BKPF
 WHERE bukrs in bukrs and budat between  budat-low and budat-high .

IF SY-SUBRC EQ 0.
 
 select bukrs hkont gsber shkzg dmbtr 
 from bseg
 INTO TABLE IT_BSEG
 where bukrs in bukrs and hkont in hkont and gsber in gsber
 and belnr = itab-belnr.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 09:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904485#M1145200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T09:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904486#M1145201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please ignore this;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 09:55:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904486#M1145201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T09:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904487#M1145202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;select a~budat a~belnr 
b~bukrs b~hkont b~gsber b~shkzg b~dmbtr into 
(itab-budat,itab-belnr,itab-bukrs,itab-hkont,itab-gsber,itab-shkzg,
tdmbtr) 
from bkpf as a inner join  bseg as b on a~belnr = b~belnr
where budat between  budat-low and budat-high and bukrs in bukrs and 
bukrs in bukrs and hkont in hkont and gsber in gsber.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im doing like this m i syntactically right..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 10:04:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904487#M1145202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T10:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904488#M1145203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nilesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  try it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select bkpf~bukrs
         bkpf~budat
         bkpf~belnr
    into table t_bkpf
    from bkpf 
   where bukrs in s_bukrs
     and budat in s_budat.
     
  select hkont
         gsber
         shkzg
         dmbtr
    into table t_bseg
     for all entries in t_bkpf
   where bukrs eq t_bkpf-bukrs
     and gsber in s_gsber
     and hkont in s_hkont.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 10:11:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904488#M1145203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T10:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904489#M1145204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;AS BSEG is the cluster table you can't use the innerjoin for that.&lt;/P&gt;&lt;P&gt;you have to the use "For all entries" only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Note&lt;/U&gt;: while using the cluster table you need to use the all primary keys in the where condition other wise you wont' get the proper data.&lt;/P&gt;&lt;P&gt;for the BSEG you have to use the BUKRS,BELNR,GJAHR,BUZEI in the where condtion. with same sequance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2008 11:20:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/4904489#M1145204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-23T11:20:47Z</dc:date>
    </item>
  </channel>
</rss>

