<?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: Avoid CDPOS Select query in loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213786#M1911134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: justify;"&gt;Mohammad,&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;You REALLY&lt;/SPAN&gt; need &lt;SPAN class="hps"&gt;review that&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;your code, &lt;/SPAN&gt;&lt;SPAN class="hps"&gt;is not&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;cool &lt;/SPAN&gt;&lt;SPAN class="hps"&gt;this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;select&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;within the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;loop&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;this is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a straight&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;punch&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;on&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;SAP&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;performance.&lt;/SPAN&gt; &lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;What&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I suggest&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is to carry out&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;consultation&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;CDPOS&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;out of the loop&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;inside it&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;make&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a READ&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;TABLE&lt;/SPAN&gt; of &lt;SPAN class="hps"&gt;this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;internal table&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;Ahhh&lt;/SPAN&gt;, adding more&lt;SPAN class="hps"&gt;... Thank you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for participating in the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;SCN&lt;/SPAN&gt;, I ask &lt;SPAN class="hps"&gt;you to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;also&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;check out the links&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;below to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;better use and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;approach&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;here&lt;/SPAN&gt;&lt;SPAN class="hps"&gt; &lt;/SPAN&gt;&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1328/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="2246" data-containertype="14" data-objectid="18590" data-objecttype="102" href="https://answers.sap.com/docs/DOC-18590"&gt;The SCN Rules of Engagement&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="60998" data-containertype="37" data-objectid="82566" data-objecttype="38" href="https://answers.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why"&gt;How to close a discussion and why&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raphael Pacheco.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Aug 2015 00:21:49 GMT</pubDate>
    <dc:creator>raphael_almeida</dc:creator>
    <dc:date>2015-08-29T00:21:49Z</dc:date>
    <item>
      <title>Avoid CDPOS Select query in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213780#M1911128</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;Working on Performance Tuning on the old custom report and came across the below code is taking more time.Can you please help me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;it_bsis_bseg&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CLEAR&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;l_srchstr&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CONCATENATE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'%'&amp;nbsp; &lt;/SPAN&gt;it_bsis_bseg&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;werks &lt;SPAN class="L0S33"&gt;'%' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;l_srchstr&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SELECT &lt;/SPAN&gt;objectid tabname fname tabkey value_old cuky_old value_new cuky_new changenr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;APPENDING &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;it_cdpos&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;cdpos&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR ALL ENTRIES IN it_bsis_bseg&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;objectclas &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'MATERIAL'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;objectid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;it_bsis_bseg&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;matnr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;tabname&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'MBEW'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;fname&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'STPRS'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;tabkey&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;LIKE &lt;/SPAN&gt;l_srchstr&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;NOT &lt;/SPAN&gt;it_cdpos[] &lt;SPAN class="L0S52"&gt;IS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INITIAL&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SELECT &lt;/SPAN&gt;objectid udate utime username tcode changenr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;cdhdr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;it_cdhdr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;FOR &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ALL &lt;/SPAN&gt;ENTRIES &lt;SPAN class="L0S52"&gt;IN &lt;/SPAN&gt;it_cdpos&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;objectclas &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'MATERIAL'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S33"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;objectid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;it_cdpos&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;objectid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;changenr&amp;nbsp; &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;it_cdpos&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;changenr&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 19:05:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213780#M1911128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-08-28T19:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid CDPOS Select query in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213781#M1911129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Why are you select-looping to select CDPOS?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;You could just loop and modify it_bsis_bseg to include the field &lt;SPAN class="L0S52" style="color: #333333; background: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #333333;"&gt;l_srchstr&lt;SPAN style="background-color: #ffffff;"&gt;, and then you select CDPOS with for all entries (testing of course if it_bsis_bseg is not empty).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;Just to mention an easy and fast solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Luis Becker&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 19:51:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213781#M1911129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-08-28T19:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid CDPOS Select query in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213782#M1911130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use TCode - ST05 for sql trace for further analysis as to which section of your Query is taking long time..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 19:51:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213782#M1911130</guid>
      <dc:creator>navin_karki1</dc:creator>
      <dc:date>2015-08-28T19:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid CDPOS Select query in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213783#M1911131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please briefly describe your requirement as well. SELECT statement on CDPOS is designed very poorly and it will create performance issue. For each iteration of loop, FOR ALL ENTRIES has been triggered. A better approach will be to check against MATNR for current iteration. However keep in mind that SELECT statements on a large table like CDPOS inside loop will create performance issue. It is recommended to use it outside loop and based on index fields if possible and also to avoid generic search statements while select. You can use ST05 for further analysis of queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 22:29:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213783#M1911131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-08-28T22:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid CDPOS Select query in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213784#M1911132</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;Thank you for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;AT &lt;/SPAN&gt;it_bsis_bseg&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;CLEAR&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;: &lt;/SPAN&gt;l_srchstr&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;CONCATENATE &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;'%'&amp;nbsp; &lt;/SPAN&gt;it_bsis_bseg&lt;SPAN class="L0S70" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;-&lt;/SPAN&gt;werks &lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;'%' &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;INTO &lt;/SPAN&gt;l_srchstr&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;SELECT &lt;/SPAN&gt;objectid tabname fname tabkey value_old cuky_old value_new cuky_new changenr&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;APPENDING &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;TABLE &lt;/SPAN&gt;it_cdpos&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;FROM &lt;/SPAN&gt;cdpos&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;WHERE &lt;/SPAN&gt;objectclas &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;EQ &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;'MATERIAL'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;AND &lt;/SPAN&gt;objectid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;EQ &lt;/SPAN&gt;it_bsis_bseg&lt;SPAN class="L0S70" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;-&lt;/SPAN&gt;matnr&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;AND &lt;/SPAN&gt;tabname&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;EQ &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;'MBEW'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;AND &lt;/SPAN&gt;fname&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;EQ &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;'STPRS'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;AND &lt;/SPAN&gt;tabkey&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;LIKE &lt;/SPAN&gt;l_srchstr&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="font-family: inherit; font-style: inherit; font-weight: inherit; background-color: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="font-family: inherit; font-style: inherit; font-weight: inherit; background-color: transparent;"&gt;@Luis: If we modify the table &lt;SPAN style="color: #333333; font-size: 12px;"&gt;it_bsis_bseg&lt;/SPAN&gt; with field&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;l_srchstr then can we able to pass multiple entries in tabkey with like keyword in select query of CDPOS because TABKEY has a combination of&amp;nbsp; WERKS and other field data also? please provide some sample code.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="color: #333333; font-style: inherit; font-size: 12px; background-color: transparent; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="color: #333333; font-style: inherit; font-size: 12px; background-color: transparent; font-family: inherit; font-weight: inherit;"&gt;Table after modification example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="color: #333333; font-style: inherit; font-size: 12px; background-color: transparent; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="color: #333333; font-style: inherit; font-size: 12px; background-color: transparent; font-family: inherit; font-weight: inherit;"&gt;MATNR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WERKS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;l_srchstr&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="color: #333333; font-style: inherit; font-size: 12px; background-color: transparent; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="color: #333333; font-style: inherit; font-size: 12px; background-color: transparent; font-family: inherit; font-weight: inherit;"&gt;100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4215&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %4215%&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="color: #333333; font-style: inherit; font-size: 12px; background-color: transparent; font-family: inherit; font-weight: inherit;"&gt;200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4225&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %4225%&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;SPAN style="color: #333333; font-style: inherit; font-size: 12px; background-color: transparent; font-family: inherit; font-weight: inherit;"&gt;300&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4235&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %4235%&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 22:52:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213784#M1911132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-08-28T22:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid CDPOS Select query in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213785#M1911133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FAE is &lt;SPAN lang="en"&gt;commented.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Warm regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Raphael Pacheco.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Aug 2015 00:10:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213785#M1911133</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2015-08-29T00:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid CDPOS Select query in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213786#M1911134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: justify;"&gt;Mohammad,&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;You REALLY&lt;/SPAN&gt; need &lt;SPAN class="hps"&gt;review that&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;your code, &lt;/SPAN&gt;&lt;SPAN class="hps"&gt;is not&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;cool &lt;/SPAN&gt;&lt;SPAN class="hps"&gt;this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;select&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;within the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;loop&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;this is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a straight&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;punch&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;on&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;SAP&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;performance.&lt;/SPAN&gt; &lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;What&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I suggest&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is to carry out&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;consultation&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;CDPOS&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;out of the loop&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;inside it&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;make&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a READ&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;TABLE&lt;/SPAN&gt; of &lt;SPAN class="hps"&gt;this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;internal table&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;Ahhh&lt;/SPAN&gt;, adding more&lt;SPAN class="hps"&gt;... Thank you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for participating in the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;SCN&lt;/SPAN&gt;, I ask &lt;SPAN class="hps"&gt;you to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;also&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;check out the links&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;below to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;better use and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;approach&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;here&lt;/SPAN&gt;&lt;SPAN class="hps"&gt; &lt;/SPAN&gt;&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1328/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="2246" data-containertype="14" data-objectid="18590" data-objecttype="102" href="https://answers.sap.com/docs/DOC-18590"&gt;The SCN Rules of Engagement&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="60998" data-containertype="37" data-objectid="82566" data-objecttype="38" href="https://answers.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why"&gt;How to close a discussion and why&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raphael Pacheco.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Aug 2015 00:21:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-cdpos-select-query-in-loop/m-p/11213786#M1911134</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2015-08-29T00:21:49Z</dc:date>
    </item>
  </channel>
</rss>

