<?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: Expensive statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452858#M1249800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use the f1 key before u use the syntax in the program and just try to know what is the purpose of the &lt;/P&gt;&lt;P&gt;syntax used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regds&lt;/P&gt;&lt;P&gt;sachhi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Apr 2009 12:24:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-03T12:24:03Z</dc:date>
    <item>
      <title>Expensive statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452851#M1249793</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;The following statement is taking more time in the database. Kindly provide suggest me the change which can improve the performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of wa_t001,&lt;/P&gt;&lt;P&gt;        bukrs like t001-bukrs,&lt;/P&gt;&lt;P&gt;        butxt like t001-butxt,&lt;/P&gt;&lt;P&gt;      end of wa_t001,&lt;/P&gt;&lt;P&gt;      it_t001 like standard table of wa_t001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE butxt FROM t001&lt;/P&gt;&lt;P&gt;              INTO CORRESPONDING FIELDS OF wa_t001&lt;/P&gt;&lt;P&gt;              WHERE bukrs = p0001-bukrs.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    MOVE wa_t001-butxt TO i_output-butxt.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE it_t001 INTO wa_t001&lt;/P&gt;&lt;P&gt;  WITH KEY bukrs = p0001-bukrs BINARY SEARCH.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    MOVE wa_t001-butxt TO i_output-butxt.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 12:02:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452851#M1249793</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-03T12:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Expensive statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452852#M1249794</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;You have used READ TABLE it_t001 INTO wa_t001.&lt;/P&gt;&lt;P&gt;But before u use the statement&lt;/P&gt;&lt;P&gt;sort the internal table as &lt;/P&gt;&lt;P&gt;sort it_t001 by bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 12:07:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452852#M1249794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-03T12:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Expensive statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452853#M1249795</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;The READ statement mentioned by you at the end can replace the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or Am I not getting your point correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR/Manas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 12:07:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452853#M1249795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-03T12:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Expensive statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452854#M1249796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try to remove corresponding fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 12:12:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452854#M1249796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-03T12:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Expensive statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452855#M1249797</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;You can use this way...It first check's in the internal table not found then hit the DB. You can reduce the DB hits. If you are processing for one company code then one DB hit .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: begin of wa_t001,
bukrs like t001-bukrs,
butxt like t001-butxt,
end of wa_t001,
it_t001 like standard table of wa_t001.

SORT it_0001 BY bukrs.
READ TABLE it_t001 INTO wa_t001
WITH KEY bukrs = p0001-bukrs BINARY SEARCH.
IF sy-subrc = 0.
  MOVE wa_t001-butxt TO i_output-butxt.
ELSE.
  SELECT SINGLE *  FROM t001
  INTO CORRESPONDING FIELDS OF wa_t001
  WHERE bukrs = p0001-bukrs.
  IF sy-subrc = 0.
    APPEND  wa_t001 TO  it_t001 .
  ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 12:13:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452855#M1249797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-03T12:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Expensive statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452856#M1249798</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;Try following code -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of wa_t001,&lt;/P&gt;&lt;P&gt;bukrs like t001-bukrs,&lt;/P&gt;&lt;P&gt;butxt like t001-butxt,&lt;/P&gt;&lt;P&gt;end of wa_t001,&lt;/P&gt;&lt;P&gt;it_t001 like standard table of wa_t001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE butxt FROM t001&lt;/P&gt;&lt;P&gt;INTO  wa_t001-butxt&lt;/P&gt;&lt;P&gt;WHERE bukrs = p0001-bukrs.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;MOVE wa_t001-butxt TO i_output-butxt.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort it_t001 by bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE it_t001 INTO wa_t001&lt;/P&gt;&lt;P&gt;WITH KEY bukrs = p0001-bukrs BINARY SEARCH.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;MOVE wa_t001-butxt TO i_output-butxt.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 12:14:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452856#M1249798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-03T12:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Expensive statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452857#M1249799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Try  this code &lt;/P&gt;&lt;P&gt;REPORT ztest1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: t001.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa_t001,&lt;/P&gt;&lt;P&gt;      bukrs LIKE t001-bukrs,&lt;/P&gt;&lt;P&gt;      butxt LIKE t001-butxt,&lt;/P&gt;&lt;P&gt;    END OF wa_t001,&lt;/P&gt;&lt;P&gt;  it_t001 LIKE STANDARD TABLE OF wa_t001.&lt;/P&gt;&lt;P&gt;DATA: i_output_butxt TYPE t001-butxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_bukrs TYPE t001-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE bukrs butxt FROM t001&lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF wa_t001&lt;/P&gt;&lt;P&gt;       WHERE bukrs = p_bukrs.&lt;/P&gt;&lt;P&gt;APPEND wa_t001 TO it_t001.&lt;/P&gt;&lt;P&gt;READ TABLE it_t001 INTO wa_t001 WITH KEY bukrs = p_bukrs&lt;/P&gt;&lt;P&gt;                                         BINARY SEARCH.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;MOVE wa_t001-butxt TO i_output_butxt.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WRITE:/ i_output_butxt .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 12:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452857#M1249799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-03T12:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Expensive statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452858#M1249800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use the f1 key before u use the syntax in the program and just try to know what is the purpose of the &lt;/P&gt;&lt;P&gt;syntax used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regds&lt;/P&gt;&lt;P&gt;sachhi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2009 12:24:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/expensive-statement/m-p/5452858#M1249800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-03T12:24:03Z</dc:date>
    </item>
  </channel>
</rss>

