<?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: 4 way join... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522609#M239801</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. yes&lt;/P&gt;&lt;P&gt;2. yes but use this --&amp;gt;&lt;/P&gt;&lt;P&gt;FROM ( ( ( MAKT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN MARC&lt;/P&gt;&lt;P&gt;ON MAkt&lt;SUB&gt;MATNR = MArc&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN MARA&lt;/P&gt;&lt;P&gt;ON MAkt&lt;SUB&gt;MATNR = MARa&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN PRPS&lt;/P&gt;&lt;P&gt;ON makt&lt;SUB&gt;MATNR = PRPS&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE MAKT~MATNR IN S_MATNR "this is enough for validat&lt;/P&gt;&lt;P&gt;AND MAKT~SPRAS EQ SY-LANGU &lt;/P&gt;&lt;P&gt;AND MAKT~MAKTX IN S_MAKTX  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND MARA~MATKL IN S_MATKL &lt;/P&gt;&lt;P&gt;AND MARA~MEINS IN S_MEINS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND MARC~WERKS IN S_WERKS &lt;/P&gt;&lt;P&gt;AND MARC~DISPO IN S_DISPO &lt;/P&gt;&lt;P&gt;AND MARC~FEVOR IN S_FEVOR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND PRPS~PSPNR IN S_PSPNR&lt;/P&gt;&lt;P&gt;AND PRPS~VERNR IN S_VERNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this is usefull...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Aug 2006 23:07:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-28T23:07:23Z</dc:date>
    <item>
      <title>4 way join...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522607#M239799</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;I have a three way join between MARA, MARC and  MAKT that works great. I want to make it a four way join to include two fields from PRPS as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT MAKT~MATNR                              &lt;/P&gt;&lt;P&gt;         MAKT~MAKTX                              &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         MARA~MATKL                              &lt;/P&gt;&lt;P&gt;         MARA~MEINS                              &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         MARC~WERKS                             &lt;/P&gt;&lt;P&gt;         MARC~DISPO                             &lt;/P&gt;&lt;P&gt;         MARC~FEVOR                              &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         PRPS~PSPNR&lt;/P&gt;&lt;P&gt;         PRPS~VERNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   INTO CORRESPONDING FIELDS OF TABLE GT_SUPPLY_DEMAND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   FROM ( (  ( MAKT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         INNER JOIN MARC&lt;/P&gt;&lt;P&gt;         ON MARC&lt;SUB&gt;MATNR = MAKT&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         INNER JOIN MARA&lt;/P&gt;&lt;P&gt;         ON MARA&lt;SUB&gt;MATNR = MARC&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         INNER JOIN PRPS&lt;/P&gt;&lt;P&gt;         ON PRPS&lt;SUB&gt;MATNR = MARC&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         WHERE MAKT~MATNR IN S_MATNR             &lt;/P&gt;&lt;P&gt;         AND MAKT~SPRAS EQ SY-LANGU              &lt;/P&gt;&lt;P&gt;         AND MAKT~MAKTX IN S_MAKTX               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         AND MARA~MATNR IN S_MATNR              &lt;/P&gt;&lt;P&gt;         AND MARA~MATKL IN S_MATKL               &lt;/P&gt;&lt;P&gt;         AND MARA~MEINS IN S_MEINS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         AND MARC~WERKS IN S_WERKS              &lt;/P&gt;&lt;P&gt;         AND MARC~DISPO IN S_DISPO               &lt;/P&gt;&lt;P&gt;         AND MARC~FEVOR IN S_FEVOR               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         AND PRPS~PSPNR IN S_PSPNR&lt;/P&gt;&lt;P&gt;         AND PRPS~VERNR IN S_VERNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are my questions:&lt;/P&gt;&lt;P&gt;1. matnr is a key in prps. Can I still do a join on that field even though it is not a key?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Do I have to include a select on matnr using the select option paramter against every matnr for each table...or can I just select against its origin table of MAKT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Can I even do this &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2006 22:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522607#M239799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-28T22:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: 4 way join...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522608#M239800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1)  Yes, you can join on any field, but it will decrease the performance if not key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)  No, just one of the fields, in the WHERE clause, preferrable the key field of the top most table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHERE MAKT~MATNR IN S_MATNR 
AND MAKT~SPRAS EQ SY-LANGU 
AND MAKT~MAKTX IN S_MAKTX 

&amp;lt;b&amp;gt;*AND MARA~MATNR IN S_MATNR&amp;lt;/b&amp;gt; 
AND MARA~MATKL IN S_MATKL 
AND MARA~MEINS IN S_MEINS

AND MARC~WERKS IN S_WERKS 
AND MARC~DISPO IN S_DISPO 
AND MARC~FEVOR IN S_FEVOR 

AND PRPS~PSPNR IN S_PSPNR
AND PRPS~VERNR IN S_VERNR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Sure, you can join as many as you want, but make sure to join correctly, and it is suggested to keep the joins to a lowere number, I'd say 3-4 or less.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2006 22:48:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522608#M239800</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-28T22:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: 4 way join...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522609#M239801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. yes&lt;/P&gt;&lt;P&gt;2. yes but use this --&amp;gt;&lt;/P&gt;&lt;P&gt;FROM ( ( ( MAKT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN MARC&lt;/P&gt;&lt;P&gt;ON MAkt&lt;SUB&gt;MATNR = MArc&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN MARA&lt;/P&gt;&lt;P&gt;ON MAkt&lt;SUB&gt;MATNR = MARa&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN PRPS&lt;/P&gt;&lt;P&gt;ON makt&lt;SUB&gt;MATNR = PRPS&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE MAKT~MATNR IN S_MATNR "this is enough for validat&lt;/P&gt;&lt;P&gt;AND MAKT~SPRAS EQ SY-LANGU &lt;/P&gt;&lt;P&gt;AND MAKT~MAKTX IN S_MAKTX  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND MARA~MATKL IN S_MATKL &lt;/P&gt;&lt;P&gt;AND MARA~MEINS IN S_MEINS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND MARC~WERKS IN S_WERKS &lt;/P&gt;&lt;P&gt;AND MARC~DISPO IN S_DISPO &lt;/P&gt;&lt;P&gt;AND MARC~FEVOR IN S_FEVOR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND PRPS~PSPNR IN S_PSPNR&lt;/P&gt;&lt;P&gt;AND PRPS~VERNR IN S_VERNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this is usefull...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2006 23:07:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522609#M239801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-28T23:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: 4 way join...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522610#M239802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes...I thought I tried something like that...but if I enter no values for my select option parameters nothing is returned. Without the fourth join I return all materials. Why does the fourth join cause no values to be returned even though there are values in MARA, MAKT, MARC and PRPS that match?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 00:03:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522610#M239802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T00:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: 4 way join...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522611#M239803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I get it...the low and high value for the PRPS fields are both set to 00000000. As a result...nothing comes back &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 00:12:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522611#M239803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T00:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: 4 way join...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522612#M239804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My 4 way join returns no values if my user doesn't set a value for PROJ-VERNR and PROJ-PSPNR. This is because by default the low/high parameters for these selct options are set to all zeros. I thought I could work around this problem by testing for those values and resetting the high end for both to '99999999'....but no luck, still no values returned. I also attempted to embed an IF statemnt in the query that would ignore the PROJ fields as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         IF L_IGNORE_PS_SELECT_OPTIONS = 'X'.&lt;/P&gt;&lt;P&gt;           INNER JOIN PRPS&lt;/P&gt;&lt;P&gt;             ON MAKT&lt;SUB&gt;MATNR = PRPS&lt;/SUB&gt;MATNR )&lt;/P&gt;&lt;P&gt;         ENDIF.&lt;/P&gt;&lt;P&gt;This doesn't work either. Is there another way to work around this issue. Aside from creating to completely seperate queries...one that includes the PROJ fields...and one that does not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:00:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/4-way-join/m-p/1522612#M239804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T11:00:08Z</dc:date>
    </item>
  </channel>
</rss>

