<?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: writing the perfect code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147596#M748339</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sneha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some of the following Points we can consider at that time of developing our code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.Use WHERE clause in your SELECT statement to restrict the volume of data retrieved. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.Design your Query to Use as much index fields as possible from left to right in your WHERE statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.Either enable buffering in your database table or create Indexes to speed up the query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.Avoid using nested SELECT statement, SELECT within LOOPs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7.Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8.Avoid using SELECT * and Select only the required fields from the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9.Avoid nested loops when working with large internal tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10.  Use assign instead of into in LOOPs for table types with large work areas &lt;/P&gt;&lt;P&gt;11.When in doubt call transaction SE30 and use the examples and check your code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12.Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;13.Use "CHECK" instead of IF/ENDIF whenever possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14.Use "CASE" instead of IF/ENDIF whenever possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;15.    Use "MOVE" with individual variable/field moves instead of "MOVE-CORRESPONDING", creates more coding but is more   effcient. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and some more Analysis Transactions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SM51 &amp;#150; App. Servers Overview &lt;/P&gt;&lt;P&gt;STAT &amp;#150; Display Statistical Records&lt;/P&gt;&lt;P&gt;ST05 &amp;#150; SQL Trace&lt;/P&gt;&lt;P&gt;SE30 &amp;#150; Runtime Analysis&lt;/P&gt;&lt;P&gt;ST03 &amp;#150; Analysis of Workload&lt;/P&gt;&lt;P&gt;DB02 &amp;#150; Database Performance : Tables and Indexes.&lt;/P&gt;&lt;P&gt;DB05 &amp;#150; Analysis of Table w.r.t. Indexed Fields&lt;/P&gt;&lt;P&gt;ST04 &amp;#150; Database Performance Analysis : Oracle View&lt;/P&gt;&lt;P&gt;SM66 &amp;#150; Global Work Process Overview (Over All App Servers)&lt;/P&gt;&lt;P&gt;SM50 &amp;#150; Process Overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kanagaraja L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Dec 2007 08:49:28 GMT</pubDate>
    <dc:creator>Kanagaraja_L</dc:creator>
    <dc:date>2007-12-27T08:49:28Z</dc:date>
    <item>
      <title>writing the perfect code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147594#M748337</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 your opinion, what would define the perfect code.How can we optimise our code,by using less loop statement / avoiding select * ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once we receive the Functional specifications,what should we keep in mind before we start wriitng the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 08:39:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147594#M748337</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T08:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: writing the perfect code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147595#M748338</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;Before u start ur coding see tht u do not make use of nested loops nor the nested select staements. u shold not use select * option because with this will fetch all the records frm the database. that is it hits the database evry time. &lt;/P&gt;&lt;P&gt;try avoiding loops rather try using read statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Later check for Slin errors and run code inspector then u  can code the error free program//&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;Sana.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward with points if found helpful//&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 08:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147595#M748338</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T08:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: writing the perfect code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147596#M748339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sneha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some of the following Points we can consider at that time of developing our code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.Use WHERE clause in your SELECT statement to restrict the volume of data retrieved. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.Design your Query to Use as much index fields as possible from left to right in your WHERE statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.Either enable buffering in your database table or create Indexes to speed up the query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.Avoid using nested SELECT statement, SELECT within LOOPs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7.Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8.Avoid using SELECT * and Select only the required fields from the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9.Avoid nested loops when working with large internal tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10.  Use assign instead of into in LOOPs for table types with large work areas &lt;/P&gt;&lt;P&gt;11.When in doubt call transaction SE30 and use the examples and check your code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12.Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;13.Use "CHECK" instead of IF/ENDIF whenever possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14.Use "CASE" instead of IF/ENDIF whenever possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;15.    Use "MOVE" with individual variable/field moves instead of "MOVE-CORRESPONDING", creates more coding but is more   effcient. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and some more Analysis Transactions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SM51 &amp;#150; App. Servers Overview &lt;/P&gt;&lt;P&gt;STAT &amp;#150; Display Statistical Records&lt;/P&gt;&lt;P&gt;ST05 &amp;#150; SQL Trace&lt;/P&gt;&lt;P&gt;SE30 &amp;#150; Runtime Analysis&lt;/P&gt;&lt;P&gt;ST03 &amp;#150; Analysis of Workload&lt;/P&gt;&lt;P&gt;DB02 &amp;#150; Database Performance : Tables and Indexes.&lt;/P&gt;&lt;P&gt;DB05 &amp;#150; Analysis of Table w.r.t. Indexed Fields&lt;/P&gt;&lt;P&gt;ST04 &amp;#150; Database Performance Analysis : Oracle View&lt;/P&gt;&lt;P&gt;SM66 &amp;#150; Global Work Process Overview (Over All App Servers)&lt;/P&gt;&lt;P&gt;SM50 &amp;#150; Process Overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kanagaraja L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 08:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147596#M748339</guid>
      <dc:creator>Kanagaraja_L</dc:creator>
      <dc:date>2007-12-27T08:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: writing the perfect code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147597#M748340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first of all if u need to retrieve data from database try looking for suitable logical database program..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u cannot find one fulfilling ur requirement, u've to write ur own select statements...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading multiple database tables requires careful consideration and considerable analysis to ensure&lt;/P&gt;&lt;P&gt;that the data retrieval is efficient.&lt;/P&gt;&lt;P&gt;  To ensure optimal database performance, follow these general rules:&lt;/P&gt;&lt;P&gt;  Keep the amount of selected data as small as possible. Use WHERE conditions on all SELECT&lt;/P&gt;&lt;P&gt;statements. Rather than accumulating values programmatically, see if you can use the SQL&lt;/P&gt;&lt;P&gt;aggregate functions MIN, MAX, AVG, SUM, and COUNT(*). Use the DISTINCT phrase as&lt;/P&gt;&lt;P&gt;opposed to an array fetch, sort, and DELETE ADJACENT DUPLICATES. Use subqueries and&lt;/P&gt;&lt;P&gt;HAVING clauses where appropriate. Whenever possible, pass the data filtering and&lt;/P&gt;&lt;P&gt;summarization off to the database engine rather than in your program logic.&lt;/P&gt;&lt;P&gt;  Keep data transfer between the application server and the database to a minimum. Do not use&lt;/P&gt;&lt;P&gt;SELECT * in report programs. Instead, use a field list and ensure the fields are retrieved in the&lt;/P&gt;&lt;P&gt;same sequence as they are defined in the data dictionary.&lt;/P&gt;&lt;P&gt;  Never use CORRESPONDING to move data.&lt;/P&gt;&lt;P&gt;  Reduce the number of database inquiries and avoid nested SELECT statements.&lt;/P&gt;&lt;P&gt;  When coding a WHERE clause, ensure that the conditions match an existing database index&lt;/P&gt;&lt;P&gt;whenever possible. The database optimizer can only use an index for data retrieval up to the point&lt;/P&gt;&lt;P&gt;where the index fields match the WHERE condition. Run a SQL trace (transaction ST05) and&lt;/P&gt;&lt;P&gt;evaluate the result of the SQL you coded in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward points if dis helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 08:50:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147597#M748340</guid>
      <dc:creator>former_member188827</dc:creator>
      <dc:date>2007-12-27T08:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: writing the perfect code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147598#M748341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Go to transcation SE30&lt;/P&gt;&lt;P&gt;See  Button 'Tips and Tricks'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is very help ful which coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Poonam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 08:51:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147598#M748341</guid>
      <dc:creator>former_member188770</dc:creator>
      <dc:date>2007-12-27T08:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: writing the perfect code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147599#M748342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the replies,I am closing this thread...Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 11:16:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/writing-the-perfect-code/m-p/3147599#M748342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T11:16:03Z</dc:date>
    </item>
  </channel>
</rss>

