<?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 not working correctly in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846741#M666929</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;the field group type is SMART in the table VBSK and also i cannot pass VBAK-vbtyp in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2007 08:50:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-19T08:50:18Z</dc:date>
    <item>
      <title>Inner join not working correctly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846738#M666926</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;Below shown is the select query generated by ABAP Query.At the time of running the abap query we are putting the ERDAT date of the contract group and Group type eq 'G' and VBAK-vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select VBSK&lt;SUB&gt;ERDAT VBSK&lt;/SUB&gt;ERNAM VBSK&lt;SUB&gt;ERNUM VBSK&lt;/SUB&gt;SAMMG VBSK&lt;SUB&gt;SMART VBSK&lt;/SUB&gt;VBNUM VBFS&lt;SUB&gt;SAMMG VBFS&lt;/SUB&gt;VBELN VBAK&lt;SUB&gt;VBELN VBAK&lt;/SUB&gt;VKORG&lt;/P&gt;&lt;P&gt;into (VBSK-ERDAT , VBSK-ERNAM , VBSK-ERNUM , VBSK-SAMMG , VBSK-SMART , VBSK-VBNUM , VBFS-SAMMG , VBFS-VBELN , VBAK-VBELN&lt;/P&gt;&lt;P&gt;     , VBAK-VKORG )&lt;/P&gt;&lt;P&gt;from ( VBSK&lt;/P&gt;&lt;P&gt;       inner join VBFS&lt;/P&gt;&lt;P&gt;       on VBFS&lt;SUB&gt;SAMMG = VBSK&lt;/SUB&gt;SAMMG&lt;/P&gt;&lt;P&gt;       inner join VBAK&lt;/P&gt;&lt;P&gt;       on VBAK&lt;SUB&gt;VBELN = VBFS&lt;/SUB&gt;VBELN )&lt;/P&gt;&lt;P&gt;       where VBSK~ERDAT in SP$00001&lt;/P&gt;&lt;P&gt;         and VBSK~SAMMG in SP$00003&lt;/P&gt;&lt;P&gt;         and VBSK~SMART in SP$00002&lt;/P&gt;&lt;P&gt;         and VBAK~VKORG in SP$00004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it is executed it is retrieving all the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody plase suggest me what is wrong in the above mentioned query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 07:49:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846738#M666926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T07:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working correctly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846739#M666927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;select VBSK~ERDAT VBSK~ERNAM VBSK~ERNUM VBSK~SAMMG VBSK~SMART VBSK~VBNUM VBFS~SAMMG VBFS~VBELN VBAK~VBELN VBAK~VKORG
into (VBSK-ERDAT , VBSK-ERNAM , VBSK-ERNUM , VBSK-SAMMG , VBSK-SMART , VBSK-VBNUM , VBFS-SAMMG , VBFS-VBELN , VBAK-VBELN
, VBAK-VKORG )
from  VBSK
inner join VBFS
on VBFS~SAMMG = VBSK~SAMMG
inner join VBAK
on VBAK~VBELN = VBFS~VBELN 
where VBSK~ERDAT in SPselect VBSK~ERDAT VBSK~ERNAM VBSK~ERNUM VBSK~SAMMG VBSK~SMART VBSK~VBNUM VBFS~SAMMG VBFS~VBELN VBAK~VBELN VBAK~VKORG
into (VBSK-ERDAT , VBSK-ERNAM , VBSK-ERNUM , VBSK-SAMMG , VBSK-SMART , VBSK-VBNUM , VBFS-SAMMG , VBFS-VBELN , VBAK-VBELN
, VBAK-VKORG )
from  VBSK
inner join VBFS
on VBFS~SAMMG = VBSK~SAMMG
inner join VBAK
on VBAK~VBELN = VBFS~VBELN 
where VBSK~ERDAT in SP$00001
and VBSK~SAMMG in SP$00003
and VBSK~SMART in SP$00002
and VBAK~VKORG in SP$00004.

and VBSK~SAMMG in SP[code]select VBSK~ERDAT VBSK~ERNAM VBSK~ERNUM VBSK~SAMMG VBSK~SMART VBSK~VBNUM VBFS~SAMMG VBFS~VBELN VBAK~VBELN VBAK~VKORG
into (VBSK-ERDAT , VBSK-ERNAM , VBSK-ERNUM , VBSK-SAMMG , VBSK-SMART , VBSK-VBNUM , VBFS-SAMMG , VBFS-VBELN , VBAK-VBELN
, VBAK-VKORG )
from  VBSK
inner join VBFS
on VBFS~SAMMG = VBSK~SAMMG
inner join VBAK
on VBAK~VBELN = VBFS~VBELN 
where VBSK~ERDAT in SP$00001
and VBSK~SAMMG in SP$00003
and VBSK~SMART in SP$00002
and VBAK~VKORG in SP$00004.
[/code]3
and VBSK~SMART in SP[code]select VBSK~ERDAT VBSK~ERNAM VBSK~ERNUM VBSK~SAMMG VBSK~SMART VBSK~VBNUM VBFS~SAMMG VBFS~VBELN VBAK~VBELN VBAK~VKORG
into (VBSK-ERDAT , VBSK-ERNAM , VBSK-ERNUM , VBSK-SAMMG , VBSK-SMART , VBSK-VBNUM , VBFS-SAMMG , VBFS-VBELN , VBAK-VBELN
, VBAK-VKORG )
from  VBSK
inner join VBFS
on VBFS~SAMMG = VBSK~SAMMG
inner join VBAK
on VBAK~VBELN = VBFS~VBELN 
where VBSK~ERDAT in SP$00001
and VBSK~SAMMG in SP$00003
and VBSK~SMART in SP$00002
and VBAK~VKORG in SP$00004.
[/code]2
and VBAK~VKORG in SP[code]select VBSK~ERDAT VBSK~ERNAM VBSK~ERNUM VBSK~SAMMG VBSK~SMART VBSK~VBNUM VBFS~SAMMG VBFS~VBELN VBAK~VBELN VBAK~VKORG
into (VBSK-ERDAT , VBSK-ERNAM , VBSK-ERNUM , VBSK-SAMMG , VBSK-SMART , VBSK-VBNUM , VBFS-SAMMG , VBFS-VBELN , VBAK-VBELN
, VBAK-VKORG )
from  VBSK
inner join VBFS
on VBFS~SAMMG = VBSK~SAMMG
inner join VBAK
on VBAK~VBELN = VBFS~VBELN 
where VBSK~ERDAT in SP$00001
and VBSK~SAMMG in SP$00003
and VBSK~SMART in SP$00002
and VBAK~VKORG in SP$00004.
[/code]4.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;leaf out the ( ) perhaps ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I don't see the group type EQ G in you're select statement ?&lt;/P&gt;&lt;P&gt;kind regards &lt;/P&gt;&lt;P&gt;arthur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 08:14:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846739#M666927</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T08:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working correctly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846740#M666928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select VBSK&lt;SUB&gt;ERDAT VBSK&lt;/SUB&gt;ERNAM VBSK&lt;SUB&gt;ERNUM VBSK&lt;/SUB&gt;SAMMG VBSK&lt;SUB&gt;SMART VBSK&lt;/SUB&gt;VBNUM VBFS&lt;SUB&gt;SAMMG VBFS&lt;/SUB&gt;VBELN VBAK&lt;SUB&gt;VBELN VBAK&lt;/SUB&gt;VKORG&lt;/P&gt;&lt;P&gt;into (VBSK-ERDAT , VBSK-ERNAM , VBSK-ERNUM , VBSK-SAMMG , VBSK-SMART , VBSK-VBNUM , VBFS-SAMMG , VBFS-VBELN , VBAK-VBELN&lt;/P&gt;&lt;P&gt;, VBAK-VKORG )&lt;/P&gt;&lt;P&gt;from  VBSK&lt;/P&gt;&lt;P&gt;inner join VBFS&lt;/P&gt;&lt;P&gt;on  VBSK&lt;SUB&gt;SAMMG = VBFS&lt;/SUB&gt;SAMMG&lt;/P&gt;&lt;P&gt;inner join VBAK&lt;/P&gt;&lt;P&gt;on VBAK&lt;SUB&gt;VBELN = VBSK&lt;/SUB&gt;VBELN &lt;/P&gt;&lt;P&gt;where VBSK~ERDAT in SP$00001&lt;/P&gt;&lt;P&gt;and VBSK~SAMMG in SP$00003&lt;/P&gt;&lt;P&gt;and VBSK~SMART in SP$00002&lt;/P&gt;&lt;P&gt;and VBAK~VBTYP eq 'G'&lt;/P&gt;&lt;P&gt;and VBAK~VKORG in SP$00004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amit Singla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 08:46:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846740#M666928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T08:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working correctly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846741#M666929</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;the field group type is SMART in the table VBSK and also i cannot pass VBAK-vbtyp in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 08:50:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846741#M666929</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T08:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working correctly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846742#M666930</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;What are these&lt;/P&gt;&lt;P&gt;SP$00001&lt;/P&gt;&lt;P&gt;SP$00003&lt;/P&gt;&lt;P&gt;SP$00002&lt;/P&gt;&lt;P&gt;SP$00004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do they have any data, check if they are empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 08:52:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846742#M666930</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-09-19T08:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working correctly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846743#M666931</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;In the select statement &lt;/P&gt;&lt;P&gt;select VBSK&lt;SUB&gt;ERDAT VBSK&lt;/SUB&gt;ERNAM VBSK&lt;SUB&gt;ERNUM VBSK&lt;/SUB&gt;SAMMG VBSK&lt;SUB&gt;SMART VBSK&lt;/SUB&gt;VBNUM VBFS&lt;SUB&gt;SAMMG VBFS&lt;/SUB&gt;VBELN VBAK&lt;SUB&gt;VBELN VBAK&lt;/SUB&gt;VKORG&lt;/P&gt;&lt;P&gt;into (VBSK-ERDAT , VBSK-ERNAM , VBSK-ERNUM , VBSK-SAMMG , VBSK-SMART , VBSK-VBNUM , VBFS-SAMMG , VBFS-VBELN , VBAK-VBELN&lt;/P&gt;&lt;P&gt;, VBAK-VKORG )&lt;/P&gt;&lt;P&gt;from ( VBSK&lt;/P&gt;&lt;P&gt;inner join VBFS&lt;/P&gt;&lt;P&gt;on VBFS&lt;SUB&gt;SAMMG = VBSK&lt;/SUB&gt;SAMMG&lt;/P&gt;&lt;P&gt;inner join VBAK&lt;/P&gt;&lt;P&gt;on VBAK&lt;SUB&gt;VBELN = VBFS&lt;/SUB&gt;VBELN )&lt;/P&gt;&lt;P&gt;where VBSK~ERDAT in SP$00001&lt;/P&gt;&lt;P&gt;and VBSK~SAMMG in SP$00003&lt;/P&gt;&lt;P&gt;and VBSK~SMART in SP$00002&lt;/P&gt;&lt;P&gt;and VBAK~VKORG in SP$00004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below mentioned is the select options name in which the values entered on the selection screen screen will be passed.&lt;/P&gt;&lt;P&gt;Please let me know what will be the effect if in am not passing the SAMMG value in the selection screen.&lt;/P&gt;&lt;P&gt;SP$00001&lt;/P&gt;&lt;P&gt;SP$00003&lt;/P&gt;&lt;P&gt;SP$00002&lt;/P&gt;&lt;P&gt;SP$00004&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 08:56:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846743#M666931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T08:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working correctly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846744#M666932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : begin of it1 occurs 0,&lt;/P&gt;&lt;P&gt;         define all fields here of all three tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       end of it1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of it2 occurs 0,&lt;/P&gt;&lt;P&gt;         define vbak field here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         endif.&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;select VBSK&lt;SUB&gt;ERDAT VBSK&lt;/SUB&gt;ERNAM VBSK&lt;SUB&gt;ERNUM VBSK&lt;/SUB&gt;SAMMG VBSK&lt;SUB&gt;SMART VBSK&lt;/SUB&gt;VBNUM VBFS&lt;SUB&gt;SAMMG VBFS&lt;/SUB&gt;VBELN from VBSK&lt;/P&gt;&lt;P&gt;inner join VBFS&lt;/P&gt;&lt;P&gt;on VBSK&lt;SUB&gt;SAMMG = VBFS&lt;/SUB&gt;SAMMG&lt;/P&gt;&lt;P&gt;into corresponding fields of itab1 &lt;/P&gt;&lt;P&gt;where VBSK~ERDAT in SP$00001&lt;/P&gt;&lt;P&gt;and VBSK~SAMMG in SP$00003&lt;/P&gt;&lt;P&gt;and VBSK~SMART in SP$00002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not it1[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select VBELN&lt;/P&gt;&lt;P&gt;          VKORG &lt;/P&gt;&lt;P&gt;          from vbak &lt;/P&gt;&lt;P&gt;          into corresponding fields of it2 for all entries in it1&lt;/P&gt;&lt;P&gt;          where vbtyp = 'G' and&lt;/P&gt;&lt;P&gt;                    vbeln = it1-vbeln.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it2 with key vbeln = it1-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it1-vbeln1 = it2-vbeln.&lt;/P&gt;&lt;P&gt;it1-vkorg =it2-vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify it1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 09:24:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846744#M666932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T09:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working correctly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846745#M666933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select statement is generated by ABAP Query itself and our problemis why this select statement is not working correctly in the production system.The output contains Contract group that sre not created in the date range specified on the selection screen and it will pick that contract group also that are not of type 'G'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 09:37:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working-correctly/m-p/2846745#M666933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T09:37:11Z</dc:date>
    </item>
  </channel>
</rss>

