<?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: performance issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666173#M882961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In palce of Move corresponding just transfer the  data in the corresponding fields filed by field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When records a and b have the exact same structure, it is more efficient to MOVE a TO b than to &lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING a TO b.&lt;/P&gt;&lt;P&gt;MOVE BSEG TO  *BSEG.  	&lt;/P&gt;&lt;P&gt;Is better than&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING BSEG TO *BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ashish Paliwal on Apr 16, 2008 8:31 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 16, 2008 1:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Apr 2008 14:57:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-16T14:57:29Z</dc:date>
    <item>
      <title>performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666172#M882960</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;Pls check this piece of code .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My focus is on performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help me to improve effeciency of  this code.&lt;/P&gt;&lt;P&gt;Moving all the respective internal tables to i_customermaster.&lt;/P&gt;&lt;P&gt;    LOOP AT I_KNA1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE I_ADRC WITH KEY ADDRNUMBER = I_KNA1-ADRNR.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_KNA1 TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_ADRC TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      READ TABLE I_ADR2 WITH KEY ADDRNUMBER = I_KNA1-ADRNR.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_ADR2 TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      READ TABLE I_ADR6 WITH KEY ADDRNUMBER = I_KNA1-ADRNR.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_ADR6 TO I_CUSTOMERMASTER.&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;      READ TABLE I_KNVV WITH KEY KUNNR = I_KNA1-KUNNR.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_KNVV TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE I_J1IMOCUST WITH KEY KUNNR = I_KNA1-KUNNR.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_J1IMOCUST TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE I_KNBK WITH KEY KUNNR = I_KNA1-KUNNR.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_KNBK TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE I_KNB1 WITH KEY KUNNR = I_KNA1-KUNNR.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_KNB1 TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE I_KNVK WITH KEY KUNNR = I_KNA1-KUNNR.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_KNVK TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE I_BNKA WITH KEY BANKS = I_KNBK-BANKS .&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_BNKA TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE I_TSAD3T WITH KEY TITLE = I_ADRC-TITLE .&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING I_TSAD3T TO I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      WRITE : / I_CUSTOMERMASTER.&lt;/P&gt;&lt;P&gt;      I_CUSTOMERMASTER-ZDATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;      I_CUSTOMERMASTER-ZTIME = SY-UZEIT.&lt;/P&gt;&lt;P&gt;      I_CUSTOMERMASTER-FLAG = 'X'.&lt;/P&gt;&lt;P&gt;      "To indicate the records to be transferred.&lt;/P&gt;&lt;P&gt;      ZCUSTOMER_MASTER = I_CUSTOMERMASTER. "To update the Z-Table.&lt;/P&gt;&lt;P&gt;      MODIFY ZCUSTOMER_MASTER.&lt;/P&gt;&lt;P&gt;      MODIFY I_CUSTOMERMASTER.&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, 16 Apr 2008 14:52:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666172#M882960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-16T14:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666173#M882961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In palce of Move corresponding just transfer the  data in the corresponding fields filed by field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When records a and b have the exact same structure, it is more efficient to MOVE a TO b than to &lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING a TO b.&lt;/P&gt;&lt;P&gt;MOVE BSEG TO  *BSEG.  	&lt;/P&gt;&lt;P&gt;Is better than&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING BSEG TO *BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ashish Paliwal on Apr 16, 2008 8:31 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 16, 2008 1:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 14:57:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666173#M882961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-16T14:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666174#M882962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When ever u use READ TABLE add  BINARY SEARCH clause at the end.Prior to read statement sort itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 15:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666174#M882962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-16T15:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666175#M882963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jaya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks to me like all these internal tables are hashed tables. WIth a quick look, I don't see anything blatantly wrong with the code you have posted with the exception of the below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT I_CUSTOMERMASTER.
  WRITE : / I_CUSTOMERMASTER.
  I_CUSTOMERMASTER-ZDATE = SY-DATUM.
  I_CUSTOMERMASTER-ZTIME = SY-UZEIT.
  I_CUSTOMERMASTER-FLAG = 'X'.
  "To indicate the records to be transferred.
  ZCUSTOMER_MASTER = I_CUSTOMERMASTER. "To update the Z-Table.
  MODIFY ZCUSTOMER_MASTER.
  MODIFY I_CUSTOMERMASTER.

ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above code, Z table is being updated one record at a time. Firstly, MODIFY is an expensive statement. Secondly, updating one at a time, is inefficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look for help on MODIFY statement. Do something like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT I_CUSTOMERMASTER.
  WRITE : / I_CUSTOMERMASTER.
  I_CUSTOMERMASTER-ZDATE = SY-DATUM.
  I_CUSTOMERMASTER-ZTIME = SY-UZEIT.
  I_CUSTOMERMASTER-FLAG = 'X'.
  "To indicate the records to be transferred.
  ZCUSTOMER_MASTER = I_CUSTOMERMASTER. "To update the Z-Table.
  MODIFY I_CUSTOMERMASTER.
ENDLOOP.

MODIFY ZCUSTOMER_MASTER FROM TABLE I_CUSTOMERMASTER.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there are a lot of records in I_CUSTOMERMASTER table, you may see significant improvement. Otherwise, you have to look elsewhere. Run time analysis (SE30) will help you in that task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sudhi Karkada on Apr 16, 2008 5:12 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 15:09:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666175#M882963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-16T15:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666176#M882964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sudi...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But When I checked after making changes to my code it didnt make any diffrence...Dnt know why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;response time was agin talmost same..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 04:59:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3666176#M882964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T04:59:43Z</dc:date>
    </item>
  </channel>
</rss>

