<?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: Need simple and effecient select. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652135#M1285970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sri,&lt;/P&gt;&lt;P&gt;I wrote the Join condition , please check that --&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT marc~matnr
       FROM mara INNER JOIN marc
       ON mara~matnr = marc~matnr
         WHERE mara~matnr = i_stag_table-zzitem_code AND
               mara~mtart = 'ZHAB'
         INTO TABLE  l_temp_matnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2009 14:50:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-06T14:50:20Z</dc:date>
    <item>
      <title>Need simple and effecient select.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652130#M1285965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;         Iam using the select as below ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         Select  MATNR from MARA into l_temp_MATNR  where&lt;/P&gt;&lt;P&gt;                                                                                MATNR =  I_stag_tableZZITEM_CODE.&lt;/P&gt;&lt;P&gt;                                                                                MTART = 'ZHAB'.&lt;/P&gt;&lt;P&gt;         Append l_temp_MATNR  &lt;/P&gt;&lt;P&gt;        Endloop.&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;P&gt;Loop at  l_temp_MATNR  .&lt;/P&gt;&lt;P&gt;        Select  MATNR from MARC into l_temp_MATNR  where&lt;/P&gt;&lt;P&gt;                                                                                MATNR =  l_temp_MATNR -MATNR&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one combine it into join condtion ? wether it is possible .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 13:46:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652130#M1285965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T13:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need simple and effecient select.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652131#M1285966</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;Try this&lt;/P&gt;&lt;P&gt;Declare i_matnr type mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select MATNR from MARA into table l_MATNR where&lt;/P&gt;&lt;P&gt;MATNR = I_stag_table-ZZITEM_CODE and&lt;/P&gt;&lt;P&gt;MTART = 'ZHAB'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i_matnr is not initial.&lt;/P&gt;&lt;P&gt;Select MATNR from MARC into l_temp_MATNR for all entries in i_matnr&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;MATNR = l_MATNR -MATNR&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;Regards&lt;/P&gt;&lt;P&gt;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 13:50:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652131#M1285966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T13:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need simple and effecient select.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652132#M1285967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you try writing the JOIN yourself and get back to the forum if you have a problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hmmmm.... now that I look at it a bit more closely, I don't see any logic behind what you are trying to do (retrieve MATNR knowing MATNR). Some other issues as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So why don't you refine your logic and &lt;STRONG&gt;then&lt;/STRONG&gt; get back to the forum?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on May 6, 2009 10:06 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 14:00:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652132#M1285967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T14:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need simple and effecient select.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652133#M1285968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i dont know why do you want to use two selects here.&lt;/P&gt;&lt;P&gt;I would suggest you to go for a join on mara and marc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also include plant in your internal table, so that you are easily able to identify the material belongs to which plant. Or use select with distinct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select distinct matnr
from mara as a join marc as b
into table i_tab
on a~matnr = b~matnr
where a~matnr = I_stag_table-ZZITEM_CODE and
          a~mtart = 'ZHAB'. " I'd prefer not to hardcode the material type here.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abdullah&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ZAFCO ABAP on May 6, 2009 6:01 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 14:00:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652133#M1285968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T14:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need simple and effecient select.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652134#M1285969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
select t2~matnr
   from mara as t1 innerjoin marc as t2
   on t1~matnr = t2~matnr
   into table &amp;lt;itab&amp;gt;
   where t1~matnr = I_stag_tableZZITEM_CODE
       and t1~mtart =  'ZHAB'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Satya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 14:01:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652134#M1285969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T14:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need simple and effecient select.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652135#M1285970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sri,&lt;/P&gt;&lt;P&gt;I wrote the Join condition , please check that --&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT marc~matnr
       FROM mara INNER JOIN marc
       ON mara~matnr = marc~matnr
         WHERE mara~matnr = i_stag_table-zzitem_code AND
               mara~mtart = 'ZHAB'
         INTO TABLE  l_temp_matnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 14:50:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-simple-and-effecient-select/m-p/5652135#M1285970</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T14:50:20Z</dc:date>
    </item>
  </channel>
</rss>

