<?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: Read statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842782#M665804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is ok, if the no of values in the internal table is quite large where you are reading from. There is no efficiency issue in that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sheron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2007 09:25:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-03T09:25:35Z</dc:date>
    <item>
      <title>Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842778#M665800</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;As per my requirement I should use READ statement for 7 times in a loop ( loop at itab). In every read statement I have to use only one field in "with key" addition.&lt;/P&gt;&lt;P&gt;Is it efficient to use READ multiple times ? Is there any alternative to do the same task?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subbu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 09:21:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842778#M665800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T09:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842779#M665801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No there will not be any problem. &lt;/P&gt;&lt;P&gt;Read will read only one line. so no harm.&lt;/P&gt;&lt;P&gt;Reward if useful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 09:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842779#M665801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T09:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842780#M665802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is no problem to put READ statement inside the LOOP &lt;/P&gt;&lt;P&gt;its a better way to put &lt;/P&gt;&lt;P&gt;to avoid SELECT in a LOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see this example &lt;/P&gt;&lt;P&gt;i had used that in my program &lt;/P&gt;&lt;P&gt;in the performance point of view it is a good method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_SOBID INTO WA_SOBID." where otype eq s_otype and objid eq s_objid.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    READ TABLE IT_HRP1026 WITH KEY OBJID = WA_SOBID-SOBID OTYPE = WA_SOBID-SCLAS INTO WA_HRP1026.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;      READ TABLE IT_HRP1000 WITH KEY OBJID = WA_SOBID-SOBID INTO WA_HRP1000.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;      WA_OUTPUT-OBJID = WA_HRP1026-OBJID.&lt;/P&gt;&lt;P&gt;      WA_OUTPUT-BEGDA = WA_SOBID-BEGDA.&lt;/P&gt;&lt;P&gt;      WA_OUTPUT-ENDDA = WA_SOBID-ENDDA.&lt;/P&gt;&lt;P&gt;      WA_OUTPUT-AEDTM = WA_HRP1026-AEDTM.&lt;/P&gt;&lt;P&gt;      WA_OUTPUT-UNAME = WA_HRP1026-UNAME.&lt;/P&gt;&lt;P&gt;      WA_OUTPUT-STEXT = WA_HRP1000-STEXT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;      READ TABLE IT_REASON WITH KEY CANCR = WA_HRP1026-CANCR INTO WA_REASON.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;      WA_OUTPUT-CANCRT = WA_REASON-CANCRT.&lt;/P&gt;&lt;P&gt;      CLEAR WA_REASON-CANCRT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;      READ TABLE IT_LOCATION1 WITH KEY OBJID = WA_HRP1026-OBJID INTO WA_LOCATION1..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;      READ TABLE IT_LSTEXT WITH KEY OBJID = WA_LOCATION1-SOBID OTYPE = 'F' INTO WA_LSTEXT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;             WA_OUTPUT-LSTEXT = WA_LSTEXT-LSTEXT.&lt;/P&gt;&lt;P&gt;             CLEAR WA_LSTEXT-LSTEXT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;      APPEND WA_OUTPUT TO IT_OUTPUT.&lt;/P&gt;&lt;P&gt;      CLEAR WA_OUTPUT.&lt;/P&gt;&lt;P&gt;      CLEAR WA_OUTPUT-CANCRT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OF COURSE U CAN PUT READ IN THE LOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for performance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;be sure for follwing things...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort the table with the key fields on which u r putting read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then write the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IT INTO WA WITH KEY XYZ = ' ' BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vasu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 09:23:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842780#M665802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T09:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842781#M665803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the fields are different in the WITH KEY clause then copy internal tables accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No affect on performance if using binary search &amp;amp; sorting tables before the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move : itab to itab1,&lt;/P&gt;&lt;P&gt;           itab to itab2,&lt;/P&gt;&lt;P&gt;           itab to itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort : itab1 by field1,&lt;/P&gt;&lt;P&gt;        itab2 by field2,&lt;/P&gt;&lt;P&gt;        itab3 by field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ioutput.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab1 with key field1 binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab2 with key field2 binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab3 with key field3 binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 09:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842781#M665803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T09:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842782#M665804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is ok, if the no of values in the internal table is quite large where you are reading from. There is no efficiency issue in that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sheron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 09:25:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842782#M665804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T09:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842783#M665805</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;IN LOOP YOU CAN USE ANY NUMBER OF READ STATEMENTS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT WON'T EFFECT THE PERFORMANCE OF THE PROGRAM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INFACT IT IS THE BEST WAY TO WRITE &lt;/P&gt;&lt;P&gt;IN MY PROGRAM I HAD WRITEN LIKE THIS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_SOBID INTO WA_SOBID." where otype eq s_otype and objid eq s_objid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IT_HRP1026 WITH KEY OBJID = WA_SOBID-SOBID OTYPE = WA_SOBID-SCLAS INTO WA_HRP1026.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;READ TABLE IT_HRP1000 WITH KEY OBJID = WA_SOBID-SOBID INTO WA_HRP1000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_OUTPUT-OBJID = WA_HRP1026-OBJID.&lt;/P&gt;&lt;P&gt;WA_OUTPUT-BEGDA = WA_SOBID-BEGDA.&lt;/P&gt;&lt;P&gt;WA_OUTPUT-ENDDA = WA_SOBID-ENDDA.&lt;/P&gt;&lt;P&gt;WA_OUTPUT-AEDTM = WA_HRP1026-AEDTM.&lt;/P&gt;&lt;P&gt;WA_OUTPUT-UNAME = WA_HRP1026-UNAME.&lt;/P&gt;&lt;P&gt;WA_OUTPUT-STEXT = WA_HRP1000-STEXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IT_REASON WITH KEY CANCR = WA_HRP1026-CANCR INTO WA_REASON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_OUTPUT-CANCRT = WA_REASON-CANCRT.&lt;/P&gt;&lt;P&gt;CLEAR WA_REASON-CANCRT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IT_LOCATION1 WITH KEY OBJID = WA_HRP1026-OBJID INTO WA_LOCATION1..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IT_LSTEXT WITH KEY OBJID = WA_LOCATION1-SOBID OTYPE = 'F' INTO WA_LSTEXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_OUTPUT-LSTEXT = WA_LSTEXT-LSTEXT.&lt;/P&gt;&lt;P&gt;CLEAR WA_LSTEXT-LSTEXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND WA_OUTPUT TO IT_OUTPUT.&lt;/P&gt;&lt;P&gt;CLEAR WA_OUTPUT.&lt;/P&gt;&lt;P&gt;CLEAR WA_OUTPUT-CANCRT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;REWARD IF USEFUL&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 09:38:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement/m-p/2842783#M665805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T09:38:56Z</dc:date>
    </item>
  </channel>
</rss>

