<?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: Result itab empty during a select join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024353#M1498413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does p_bom have a value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jun 2010 17:27:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-02T17:27:07Z</dc:date>
    <item>
      <title>Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024349#M1498409</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;Iam doing a query as follows to get the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mast&lt;SUB&gt;matnr mast&lt;/SUB&gt;stlnr makt&lt;SUB&gt;maktx mara&lt;/SUB&gt;YYBCEZNDR mvke&lt;SUB&gt;vmsta mvke&lt;/SUB&gt;prodh marc~Dispo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT mast~matnr mast~stlnr makt~maktx mara~YYBCEZNDR mvke~vmsta mvke~prodh marc~Dispo
   INTO CORRESPONDING FIELDS OF TABLE gt_mmitab FROM mast
      INNER JOIN makt ON mast~matnr = makt~matnr
      INNER JOIN mara ON makt~matnr = mara~matnr
      INNER JOIN mvke ON mara~matnr = mvke~matnr
      INNER JOIN marc ON mvke~matnr = marc~matnr
      WHERE mast~stlan = p_bom
            AND mast~matnr IN so_matnr
            AND mast~werks = '0001'
            AND makt~spras = 'D'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the itab(gt_mmitab) is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 16:06:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024349#M1498409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T16:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024350#M1498410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most obvious explanation is that your selection criteria are such that no record is found. Since you use inner join, if just one of the involved tables does not have a matching record, the overall result is empty.&lt;/P&gt;&lt;P&gt;Also, your join conditions are incomplete, so you might well end up with too many records after you fixed the initial problem. E.g. you should &lt;DEL&gt;include WERKS in the join condition of MAST and MARC&lt;/DEL&gt; link MAST and MARC via MATNR and WERKS, and not MVKE and MARC.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 16:43:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024350#M1498410</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-06-02T16:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024351#M1498411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most likely running it on a client with no data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 17:00:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024351#M1498411</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2010-06-02T17:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024352#M1498412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The client has data.It has to do something with my select statement,I gues.Somewhere something is going wrong...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 17:19:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024352#M1498412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T17:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024353#M1498413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does p_bom have a value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 17:27:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024353#M1498413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T17:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024354#M1498414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yep.In this example 8.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 17:37:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024354#M1498414</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T17:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024355#M1498415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then that's the problem. Your statement &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; WHERE mast~stlan = p_bom &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; is the culprit. You might want to define p_bom as required so the value is always filled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 17:41:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024355#M1498415</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T17:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024356#M1498416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;p_bom  is a paremeter field which is always filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;With this select Iam not trying to get a a pool of records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dont have a system at hand now.&lt;/P&gt;&lt;P&gt;Will check it tommorow after changing the select as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT mast~matnr mast~stlnr makt~maktx mara~YYBCEZNDR mvke~vmsta
mvke~prodh marc~Dispo INTO CORRESPONDING FIELDS OF TABLE gt_mmitab
FROM mast     
      INNER JOIN mara ON mast~matnr = mara~matnr
      INNER JOIN makt ON mara~matnr = makt~matnr
      INNER JOIN mvke ON mara~matnr = mvke~matnr
      INNER JOIN marc ON mara~matnr = marc~matnr
      WHERE mast~stlan = p_bom
            AND mast~matnr IN so_matnr
            AND mast~werks = '0001'
            AND makt~spras = 'D'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 17:50:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024356#M1498416</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T17:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Result itab empty during a select join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024357#M1498417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Thomas said - MARC should be joined to MAST, via MATNR and WERKS&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT mast~matnr mast~stlnr makt~maktx mara~YYBCEZNDR mvke~vmsta
mvke~prodh marc~Dispo INTO CORRESPONDING FIELDS OF TABLE gt_mmitab
FROM mast     
      INNER JOIN mara ON mast~matnr = mara~matnr
      INNER JOIN makt ON mara~matnr = makt~matnr
      INNER JOIN mvke ON mara~matnr = mvke~matnr
      INNER JOIN marc ON mast~matnr = marc~matnr
                         mast~werks = marc~werks 
      WHERE mast~stlan = p_bom
            AND mast~matnr IN so_matnr
            AND mast~werks = '0001'
            AND makt~spras = 'D'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may also be running into conversion exit problems. How is p_bom defined?  But essentially, your problem is that your SQL is too complicated to work out easily what is going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a bit of programming wisdom. Programmers are expensive. The maintainance of programs is expensive. Processor power is cheap. So, unless there is a real business requirement for absolutely tip top performance, always program for &lt;EM&gt;clarity&lt;/EM&gt; first. Break down your select into simpler units. It will be easier to find out where the failure lies. It will be easier to fix it. And it will be easier for a programmer in the future to fix it. Easier = reduced cost = &lt;STRONG&gt;a good thing&lt;/STRONG&gt; .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jun 2010 04:48:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/result-itab-empty-during-a-select-join/m-p/7024357#M1498417</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2010-06-03T04:48:21Z</dc:date>
    </item>
  </channel>
</rss>

