<?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 OpenSQL compare substring with data in an internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/opensql-compare-substring-with-data-in-an-internal-table/m-p/434682#M12501</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to have a WHERE clause in which portion of a field is to be compared with contents of a range table.&lt;/P&gt;&lt;P&gt;The SQL goes like:&lt;/P&gt;&lt;P&gt;SELECT idnlf maktx m~meins m~matnr prodh&lt;BR /&gt;
 INTO CORRESPONDING FIELDS OF TABLE lt_data&lt;BR /&gt;
 FROM mara AS m&lt;BR /&gt;
 JOIN makt AS k ON m~matnr = k~matnr AND k~spras = sy-langu&lt;BR /&gt;
 JOIN eina AS a ON m~matnr = a~matnr&lt;BR /&gt;
 JOIN mvke AS v ON m~matnr = v~matnr&lt;BR /&gt;
 WHERE v~prodh+2(3) in so_pmdpt.&lt;/P&gt;&lt;P&gt;Here so_pmdpt is a selection option (range table of 3 character long PRODH3).&lt;/P&gt;&lt;P&gt;The above OpenSQL statement doesn't compile/activate because v~prodh+2(3) is not correct syntax. PRODH is an 18 character long field and I need to compare only the substring from character 3 to character 5.&lt;/P&gt;&lt;P&gt;Can someone please hep me resolve this?&lt;/P&gt;&lt;P&gt;The reason I want to filter data in the query is because MARA is a huge table and then when its joined with MVKE becomes even bigger.&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;S.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Apr 2017 07:37:53 GMT</pubDate>
    <dc:creator>former_member547215</dc:creator>
    <dc:date>2017-04-18T07:37:53Z</dc:date>
    <item>
      <title>OpenSQL compare substring with data in an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/opensql-compare-substring-with-data-in-an-internal-table/m-p/434682#M12501</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to have a WHERE clause in which portion of a field is to be compared with contents of a range table.&lt;/P&gt;&lt;P&gt;The SQL goes like:&lt;/P&gt;&lt;P&gt;SELECT idnlf maktx m~meins m~matnr prodh&lt;BR /&gt;
 INTO CORRESPONDING FIELDS OF TABLE lt_data&lt;BR /&gt;
 FROM mara AS m&lt;BR /&gt;
 JOIN makt AS k ON m~matnr = k~matnr AND k~spras = sy-langu&lt;BR /&gt;
 JOIN eina AS a ON m~matnr = a~matnr&lt;BR /&gt;
 JOIN mvke AS v ON m~matnr = v~matnr&lt;BR /&gt;
 WHERE v~prodh+2(3) in so_pmdpt.&lt;/P&gt;&lt;P&gt;Here so_pmdpt is a selection option (range table of 3 character long PRODH3).&lt;/P&gt;&lt;P&gt;The above OpenSQL statement doesn't compile/activate because v~prodh+2(3) is not correct syntax. PRODH is an 18 character long field and I need to compare only the substring from character 3 to character 5.&lt;/P&gt;&lt;P&gt;Can someone please hep me resolve this?&lt;/P&gt;&lt;P&gt;The reason I want to filter data in the query is because MARA is a huge table and then when its joined with MVKE becomes even bigger.&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;S.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 07:37:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/opensql-compare-substring-with-data-in-an-internal-table/m-p/434682#M12501</guid>
      <dc:creator>former_member547215</dc:creator>
      <dc:date>2017-04-18T07:37:53Z</dc:date>
    </item>
  </channel>
</rss>

