<?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: Help in join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-join/m-p/5977995#M1340348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the ON section is used to connect the two tables in the SELECT statement, so you should provide the fields which connect the two. For example, if  A has a user id field and so does B, then your ON statement should look like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;on a~user_id = b~user_id&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can do your restrictions in the WHERE clause like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;where a~user_id = iv_user_id.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the finished SELECT statement might look like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT a~app a~appr b~atid b~attal
    INTO CORRESPONDING FIELDS OF TABLE  app_att_tab
    FROM ( Z_app as a
    INNER JOIN Zd_d_apat as b
                      ON a~userid = b~user_id )
                                   where a~user_id = iv_user_id.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2009 16:02:31 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2009-08-06T16:02:31Z</dc:date>
    <item>
      <title>Help in join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-join/m-p/5977994#M1340347</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;&lt;/P&gt;&lt;P&gt;i want to do join and i have error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT a~app a~appr b~atid b~attal
    INTO CORRESPONDING FIELDS OF TABLE  app_att_tab
    FROM ( Z_app as a
    INNER JOIN Zd_d_apat ON a~userid = iv_userid ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iv_user id is parameter that i get in the input FM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the error is :&lt;/P&gt;&lt;P&gt;You cannot compare with "IV_USERID". Each comparison in the ON&lt;/P&gt;&lt;P&gt;condition must contain a field from the RH table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Joy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 15:56:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-join/m-p/5977994#M1340347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T15:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help in join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-join/m-p/5977995#M1340348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the ON section is used to connect the two tables in the SELECT statement, so you should provide the fields which connect the two. For example, if  A has a user id field and so does B, then your ON statement should look like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;on a~user_id = b~user_id&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can do your restrictions in the WHERE clause like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;where a~user_id = iv_user_id.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the finished SELECT statement might look like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT a~app a~appr b~atid b~attal
    INTO CORRESPONDING FIELDS OF TABLE  app_att_tab
    FROM ( Z_app as a
    INNER JOIN Zd_d_apat as b
                      ON a~userid = b~user_id )
                                   where a~user_id = iv_user_id.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 16:02:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-join/m-p/5977995#M1340348</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2009-08-06T16:02:31Z</dc:date>
    </item>
  </channel>
</rss>

