<?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/851581#M46296</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;Did you check whether PA0001 and PA0006 has data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jun 2005 20:24:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-06-02T20:24:24Z</dc:date>
    <item>
      <title>Inner Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851580#M46295</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 Inner Join on two tables PA0001 and PA0006 on the field PERNR. But I am getting nothing as output.&lt;/P&gt;&lt;P&gt; The code is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: PA0001, PA0006.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INFOTYPES: 0001, 0006.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF TEST_TBL OCCURS 100,&lt;/P&gt;&lt;P&gt;        P_NAME LIKE P0001-UNAME,&lt;/P&gt;&lt;P&gt;        P_STREET LIKE P0006-STRAS,&lt;/P&gt;&lt;P&gt;        P_CITY LIKE P0006-ORT01,&lt;/P&gt;&lt;P&gt;        P_ZIP LIKE P0006-PSTLZ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      END OF TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT PA0001&lt;SUB&gt;UNAME PA0006&lt;/SUB&gt;STRAS PA0006&lt;SUB&gt;ORT01 PA0006&lt;/SUB&gt;PSTLZ&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE TEST_TBL&lt;/P&gt;&lt;P&gt;FROM ( PA0001 INNER JOIN PA0006 ON PA0001&lt;SUB&gt;PERNR = PA0006&lt;/SUB&gt;PERNR )&lt;/P&gt;&lt;P&gt;WHERE PA0006~STATE &amp;lt;&amp;gt; 'FL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: /, TEST_TBL-P_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know whether there is some logical error or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2005 19:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851580#M46295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-02T19:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851581#M46296</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;Did you check whether PA0001 and PA0006 has data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2005 20:24:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851581#M46296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-02T20:24: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/851582#M46297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes both PA0001 and PA0006 have data. In both case there are many entries for which PERNR match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2005 20:30:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851582#M46297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-02T20:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851583#M46298</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;Why do you have those parantheses in the code. Does that make any difference. Try removing those and see if that makes any diference. Also check the other where condition (for 'FL').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2005 20:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851583#M46298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-02T20:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851584#M46299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gaurav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is with the names in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use INTO CORRESPONDING FIELDS OF, it tries to match the field names of the internal table to the fields being selected from the tables.  In your case the internal table fields P_NAME, P_STREET, P_CITY, and P_ZIP doe not match the fields from the tables UNAME, STRAS, ORT01, PSTLZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can fix this by renaming the fields in your internal table, or my preferred way would be to use the AS clause in the SELECT statement.  This allows you to specify your own field names in the select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you could do your select statement like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT PA0001~UNAME AS P_NAME PA0006~STRAS AS P_STREET PA0006~ORT01 AS P_CITY PA0006~PSTLZ AS P_ZIP
INTO CORRESPONDING FIELDS OF TABLE TEST_TBL
FROM ( PA0001 INNER JOIN PA0006 ON PA0001~PERNR = PA0006~PERNR )
WHERE PA0006~STATE &amp;lt;&amp;gt; 'FL'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should fix your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2005 21:41:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851584#M46299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-02T21:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851585#M46300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, another solution in your case (although not very elegant) is that, because the structure of the fields in your select statement, and the structure of the fields in the internal table are identical (same number of fields, all fields same type, fields in same order) you could just use: INTO TABLE TEST_TBL rather than INTO CORRESPONDING FIELDS OF TABLE TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any of the 3 options I presented should fix your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2005 21:42:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851585#M46300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-02T21:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851586#M46301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestions. I incorporated the AS clause in the Select statement and its working well since then.&lt;/P&gt;&lt;P&gt;Can you tell what should I prefer if I am extracting data from more than three tables; Join or Provide clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2005 13:18:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851586#M46301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-03T13:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851587#M46302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gaurav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure that the PROVIDE clause is what you are after.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would stick with JOIN, or else create a view in SE11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2005 13:40:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851587#M46302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-03T13:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851588#M46303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually the thing is that I want to extract the values which lie between two dates entered by the user at the run time. For the users to enter the dates, I am using the Select-Options clause.The code is like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS MY_DATE FOR SY-DATUM DEFAULT '19980101' TO '19981231'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: PA0001, PA0006, PA0008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF TEST_TBL OCCURS 100,&lt;/P&gt;&lt;P&gt;        P_NAME LIKE P0001-UNAME,&lt;/P&gt;&lt;P&gt;        P_SDATE LIKE P0006-BEGDA,&lt;/P&gt;&lt;P&gt;        P_EDATE LIKE P0006-ENDDA,&lt;/P&gt;&lt;P&gt;        P_STREET LIKE P0006-STRAS,&lt;/P&gt;&lt;P&gt;        P_CITY LIKE P0006-ORT01,&lt;/P&gt;&lt;P&gt;        P_ZIP LIKE P0006-PSTLZ,&lt;/P&gt;&lt;P&gt;        P_WAGE_TYPE LIKE P0008-LGA01,&lt;/P&gt;&lt;P&gt;      END OF TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT PA0001&lt;SUB&gt;UNAME AS P_NAME PA0006&lt;/SUB&gt;STRAS AS P_STREET PA0006&lt;SUB&gt;ORT01 AS P_CITY PA0006&lt;/SUB&gt;PSTLZ AS P_ZIP PA0008~LGA01 AS P_WAGE_TYPE&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE TEST_TBL&lt;/P&gt;&lt;P&gt;FROM ( PA0001 INNER JOIN PA0006 ON PA0001&lt;SUB&gt;PERNR = PA0006&lt;/SUB&gt;PERNR &lt;/P&gt;&lt;P&gt;                INNER JOIN PA0008 ON PA0001&lt;SUB&gt;PERNR = PA0008&lt;/SUB&gt;PERNR )&lt;/P&gt;&lt;P&gt;WHERE MY_DATE BETWEEN PA0006&lt;SUB&gt;BEGDA AND PA0006&lt;/SUB&gt;ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: /, TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the dates are entered at runtime, the complier fails to recognize the variable MY_DATE and gives an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2005 13:56:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851588#M46303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-03T13:56: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/851589#M46304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guarav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your last post is still open I suggest you open a new thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jun 2005 14:27:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/851589#M46304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-05T14:27:55Z</dc:date>
    </item>
  </channel>
</rss>

