<?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: Select Single Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889463#M372652</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;i think there is no problem...&lt;/P&gt;&lt;P&gt;just clear the field v_varbl  after each passs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only problem it may lead to is performance....drop &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jan 2007 11:32:06 GMT</pubDate>
    <dc:creator>santhosh_patil</dc:creator>
    <dc:date>2007-01-08T11:32:06Z</dc:date>
    <item>
      <title>Select Single Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889460#M372649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;        I am using Select Single Statement inside a Loop for Validating , is there any problem regarding Performace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itb_file_input into wa_itb_file_input.&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;      SELECT SINGLE varbl&lt;/P&gt;&lt;P&gt;      FROM agr_1252&lt;/P&gt;&lt;P&gt;      INTO v_varbl&lt;/P&gt;&lt;P&gt;      WHERE agr_name EQ wa_itb_file_input-child&lt;/P&gt;&lt;P&gt;      AND varbl EQ wa_itb_file_input-orgname.&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Thanks .&amp;lt;/i&amp;gt;Avi.............&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:28:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889460#M372649</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select Single Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889461#M372650</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;avoid that logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) select the records into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) inside loop use read the above internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) performance will improve&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:31:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889461#M372650</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2007-01-08T11:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Select Single Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889462#M372651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it will give perfromance issues. Instead of selecting one time u r selecting multiple time right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better dont use select statement inside loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889462#M372651</guid>
      <dc:creator>alex_m</dc:creator>
      <dc:date>2007-01-08T11:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select Single Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889463#M372652</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;i think there is no problem...&lt;/P&gt;&lt;P&gt;just clear the field v_varbl  after each passs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only problem it may lead to is performance....drop &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:32:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889463#M372652</guid>
      <dc:creator>santhosh_patil</dc:creator>
      <dc:date>2007-01-08T11:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select Single Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889464#M372653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SINGLE or * a SELECT inside a Loop will always adversley affect the Performance.. Use an Itab. sort it &amp;amp; READ itab  with Key.. BINARY search for a much improved performance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:32:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889464#M372653</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2007-01-08T11:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select Single Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889465#M372654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes..u shud not use any select statment inside a loop as it will increase database hit time ..on each n every loop pass ur porgram will hit databsae and fetch entries..&lt;/P&gt;&lt;P&gt;instead of tht u can use "slect statement with clause "for all entries" in ur internal table and fetch data in one shot and then u can have loop at on tht internal table to process or validate some other conditions..it will enhance performance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it clarifies..&lt;/P&gt;&lt;P&gt;reward if helpfull.&lt;/P&gt;&lt;P&gt;u can press f1 on select statement to learn abt for all entries variant.&lt;/P&gt;&lt;P&gt;amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:33:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889465#M372654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Select Single Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889466#M372655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Avi .. Select query inside a loop always has impact on performance.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;You can use &lt;/P&gt;&lt;P&gt; Select varbl INTO i_varbl FROM agr_1252&lt;/P&gt;&lt;P&gt;          FOR ALL ENTRIES IN itb_file_input &lt;/P&gt;&lt;P&gt;                WHERE agr_name EQ itb_file_input-child&lt;/P&gt;&lt;P&gt;                             AND varbl EQ itb_file_input-orgname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i_varbl is an internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:35:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889466#M372655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select Single Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889467#M372656</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;It is better not to use SELECt within a loop, instead you can do as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT  varbl
FROM agr_1252
INTO table i_varbl
FOR ALL ENTRIES IN i_itb_file
WHERE agr_name EQ i_itb_file_input-child
AND varbl EQ i_itb_file_input-orgname.

Loop at itb_file_input into wa_itb_file_input.
......
.......
.......
......
.......
READ TABLE i_itb_file into wa_itb_file
 WITH KEY agr_name EQ wa_itb_file_input-child
         varbl EQ wa_itb_file_input-orgname.
IF sy-subrc = 0.
 v_varbl = wa_itb_file-varbl.
ENDIF.
.....

 ....

Endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you are clear.&lt;/P&gt;&lt;P&gt;Reard poinst and close the thraed if ur problem go solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:37:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-statement/m-p/1889467#M372656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:37:37Z</dc:date>
    </item>
  </channel>
</rss>

