<?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: using read statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352663#M176501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi vijay&lt;/P&gt;&lt;P&gt;for suppose i want to select the data from IHPA data base table &lt;/P&gt;&lt;P&gt;how  should i declare at begining &lt;/P&gt;&lt;P&gt;and how i should use the select statement.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 May 2006 10:28:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-29T10:28:48Z</dc:date>
    <item>
      <title>using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352650#M176488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts&lt;/P&gt;&lt;P&gt;how should i modify this statement&lt;/P&gt;&lt;P&gt;'select single parnr from ihpa into g_parnr' inorder to improve the performance.&lt;/P&gt;&lt;P&gt;can i use 'read' if yes can u plz give me the code for that&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:47:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352650#M176488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T09:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352651#M176489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP AT IHPA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE DTABLE WITH KEY PARNR = IHPA-PARNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g_parnr = IHPA-PARNR.&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;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rahul Kavuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:49:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352651#M176489</guid>
      <dc:creator>rahulkavuri</dc:creator>
      <dc:date>2006-05-29T09:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352652#M176490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sireesha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. READ statement is for reading from&lt;/P&gt;&lt;P&gt;   internal table (and not database table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Your select statement is perfectly fine,&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. we can use where condition for this table ihpa,  &lt;/P&gt;&lt;P&gt;   for fields&lt;/P&gt;&lt;P&gt;OBJNR&lt;/P&gt;&lt;P&gt;PARVW&lt;/P&gt;&lt;P&gt;COUNTER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to improve the performance.&lt;/P&gt;&lt;P&gt;(bcos they are primary key fields of this table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Other wise, there is no scope for improvement&lt;/P&gt;&lt;P&gt;   for this simple select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:50:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352652#M176490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T09:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352653#M176491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YOu cannot use a read statemkent to fetch records from database.&lt;/P&gt;&lt;P&gt;change your select single statement to this(Use the key fields in the where clause)&lt;/P&gt;&lt;P&gt;select single parnr from ihpa into g_parnr where OBJNR = p_OBJNR and PARVW = p_PARVW and COUNTER = p_COUNTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:50:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352653#M176491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T09:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352654#M176492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use identical select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore, SORT the table and use READ TABLE WITH KEY BINARY SEARCH. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USE THE FOLLOWING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort IT_VBAP BY MATNR .&lt;/P&gt;&lt;P&gt;LOOP AT IT_VBAP.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;READ TABLE IT_MAKT KEY MATNR = IT_VBAP-MATNR         &lt;/P&gt;&lt;P&gt;TRANSPORTING MAKTX binary search .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SELECT MATNR MAKTX FROM MAKT&lt;/P&gt;&lt;P&gt;APPENDING TABLE IT_MAKT-MAKTX &lt;/P&gt;&lt;P&gt;WHERE MATNR EQ IT_VBAP-MATNR.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;MOVE: IT_MAKT TO IT_VBAP-MAKTX.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Instead of: 	&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_VBAP.&lt;/P&gt;&lt;P&gt;SELECT SINGLE MAKTX INTO IT_VBAP-MAKTX&lt;/P&gt;&lt;P&gt;FROM MAKT &lt;/P&gt;&lt;P&gt;WHERE MATNR EQ IT_VBAP-MATNR.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful .&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Naresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:51:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352654#M176492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T09:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352655#M176493</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;Using read :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read t_internal_tab with key matnr = wa_mara-matnr binar search....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it's applicable to internal table only and not reading database table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz reward points and close the thread&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;gunjan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:51:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352655#M176493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T09:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352656#M176494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;GOOD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THERE IS NO MISTAKE IN YOUR SELECT STATEMENT AND I DONT THINK IT WILL GIVE YOU A BAD PERFORMANCE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;MRUTYUN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:54:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352656#M176494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T09:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352657#M176495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Your select single statement seems to be fine because it scans the table only for a single record which satisfies the condition. you can also use select upto 1 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aswin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:54:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352657#M176495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T09:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352658#M176496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you are using the &amp;lt;b&amp;gt;select single&amp;lt;/b&amp;gt; in side&amp;lt;b&amp;gt; loop&amp;lt;/b&amp;gt;, then you can use &amp;lt;b&amp;gt;for all entries&amp;lt;/b&amp;gt; and then use &amp;lt;b&amp;gt;Read&amp;lt;/b&amp;gt; in side loop as suggested by Rahul.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 09:55:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352658#M176496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T09:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352659#M176497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;READ is for reading from internal table.&lt;/P&gt;&lt;P&gt;you cannot use READ for reading from the database table.&lt;/P&gt;&lt;P&gt;Suppose if you want to fetch more than one record from a table then don't use select single instead use select field1 field2 from table1 into table itab variant this will improve your performance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul Hakim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark all useful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 10:00:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352659#M176497</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-05-29T10:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352660#M176498</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;  First select all ur PARNR into on internale table , then use READ where ever u want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELET PARNR FROM IHPA INTO TABLE IT_PARNR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then u can use this table whereever u want&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT IT_PARNR by PARNR.
eg : LOOP AT IT_FINAL.
         READ TABLE IT_PARNR WITH KEY PARNR = IT_FINAL-PARNR BINARY SEARCH.
 ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 10:03:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352660#M176498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T10:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352661#M176499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi thank u&lt;/P&gt;&lt;P&gt;do we need to declare what is dtable in the code  bcoz the code u gave is showing syntax error&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 10:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352661#M176499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T10:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352662#M176500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sireesha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes you need to declare it and then you need to select it before loop it self. check the above code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 10:22:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352662#M176500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T10:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352663#M176501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi vijay&lt;/P&gt;&lt;P&gt;for suppose i want to select the data from IHPA data base table &lt;/P&gt;&lt;P&gt;how  should i declare at begining &lt;/P&gt;&lt;P&gt;and how i should use the select statement.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 10:28:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352663#M176501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T10:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: using read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352664#M176502</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 should be like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_ihpa like ihpa occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ihpa into table it_ihpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then proceed...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 10:39:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-read-statement/m-p/1352664#M176502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T10:39:50Z</dc:date>
    </item>
  </channel>
</rss>

