<?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 abap coding  standards in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274927#M494573</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi  can u tell me the standards that are followed in a company  for ABAP CODE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 May 2007 11:02:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-21T11:02:14Z</dc:date>
    <item>
      <title>abap coding  standards</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274927#M494573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi  can u tell me the standards that are followed in a company  for ABAP CODE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2007 11:02:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274927#M494573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-21T11:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: abap coding  standards</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274928#M494574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are some coding guidelines need to be followed during coding . here are a few ones&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid dead-code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove unnecessary code and redundant processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spend time documenting and adopt good change control practices&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spend adequate time anayzing business requirements, process flows, data-structures and data-model&lt;/P&gt;&lt;P&gt;ensure careful usage of  "OR", "NOT"  and value range tables (INTTAB) that are used inappropriately in Open SQL statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f you are interested in exactly one row of a database table or view, use the SELECT SINGLE statement instead of a SELECT * statement.  SELECT SINGLE requires one&lt;/P&gt;&lt;P&gt; communication with the database system whereas SELECT * requires two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is usually faster to use the INTO TABLE version of a SELECT statement than to use APPEND statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f you want to find the maximum, minimum, sum and average value or the count of a database column, use a select list with aggregate functions instead of computing the aggregates within the program.   The RDBMS is responsible for aggregated computations instead of transferring large amount of data to the application. Overall Network, Application-server and Database load is also considerably less.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you process your data only once, use a SELECT-ENDSELECT loop instead of collecting data in an internal table with SELECT ... INTO TABLE.  Internal table handling takes up much more space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using nested selects is a technique with low performance. The inner select statement is executed several times which might be an overhead. In addition, fewer data must be transferred if another technique would be used eg. join implemented as a view in ABAP/4 Repository.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever possible, use array operations instead of single-row operations to modify the database tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frequent communication between the application program and database system produces considerable overhead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some best practices are :&lt;/P&gt;&lt;P&gt;1. Use of local variables instead of global variables - will save memory. Use global variables ony when absolutely necessary!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. (a.) Do not change variables in the "using", use the "changing" parameters instead for this purpose &lt;/P&gt;&lt;P&gt;    (b.)        "tables" parameter is now obsolete - do NOT use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Inside subroutines (forms), the using and changing parameters should have reference to a "TYPE" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. NO literals, instead use constants / text elements - as the case may be. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. All constants should be defined globally. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. Query on database tables within: loop.... endloop - to be strictly avoided &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. Internal table definition technique - using DDIC Structures and DDIC Table Types. Avoid defining local types in programs. Do not  define internal tables with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. Initialize, clear variables/work areas before internal table reads. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9. Sort internal tables before using "delete adjacent duplicates". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10. Use the "binary search" option while reading internal tables, and sort the internal table prior to read. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11. Check that the internal table has entries (not initial) before using "for all entries" option in select statements. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12. sy-ucomm = 'ONLI'?? Is this to check if program executed online or in background? Use the sy-batch variable instead &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;13. Use function modules to read: Customizing and Master tables. Only Transaction tables to be directly queried. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14. SY-SUBRC check is a MUST after all function calls; and please handle the exception suitably. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;15. Use of field symbols with internal tables [LOOP at itab ASSIGNING &amp;lt;fs&amp;gt;] is always a preferred/better option, as against loop at itab  into &amp;lt;WORK_AREA&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;16. Use of too many includes ?? (We could use: one include for global data declarations, one include for class methods, one include for  subroutines and probably one more include for Application logs)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;17. No dead code please - remove if not required. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;18. Use of case.... endcase, is preferred instead of: if.. elseif.. endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;19. Try NOT to use "into corresponding fields of" or "move corresponding" - these are detrimental from a performance perspective&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20. Instead of "select single", it is better to use "*_SINGLE_READ" function modules if available. Check always for availability of  standard function modules for data retrieval from Master / Customizing tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;21. Use of Memory ID's to be strictly avoided, as these could be overwritten globally.. Please write explicit GET, SET function modules  for this purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22. Locking the database before direct table updates is mandatory, database updates should always be in -&amp;gt; 'Update task' function  modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;23. After BAPI calls, use BAPI_TRANSACTION_COMMIT. Do NOT call BAPI_TRANSACTION_COMMIT in a loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;24. Case 'X'. when &amp;lt;variable&amp;gt; ???? - refrain from using in this manner &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;25. Provide adequate inline comments, explaining what the piece of code is supposed to do / intended to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Sridhar Srirama&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2007 11:14:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274928#M494574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-21T11:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: abap coding  standards</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274929#M494575</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;See the programming standards are given by your client to follow when developing objects..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex: &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;TY_name&amp;lt;/b&amp;gt;  for declaring global types,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;IT_TABLE&amp;lt;/b&amp;gt; for global internal tables,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;l_it_table&amp;lt;/b&amp;gt; for local internal tables,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;gc_variable&amp;lt;/b&amp;gt; for global variables.. &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;lc_var&amp;lt;/b&amp;gt; for local variables.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ty_&amp;lt;internlatablename&amp;gt;_t&amp;lt;/b&amp;gt; for Table type..&lt;/P&gt;&lt;P&gt;l_wa_itab for local work area..  etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use for all entries for better performance..&lt;/P&gt;&lt;P&gt;declare work area inside subroutines where ever necessary&lt;/P&gt;&lt;P&gt;use field symbols instaed of using work area when Modify the internal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewards if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;nazeer..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2007 11:19:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274929#M494575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-21T11:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: abap coding  standards</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274930#M494576</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;Welcome to SDN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this link for ABAP coding standards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://web.mit.edu/ist/org/admincomputing/dev/abapstds/current/" target="test_blank"&gt;http://web.mit.edu/ist/org/admincomputing/dev/abapstds/current/&lt;/A&gt;&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;Ferry Lianto&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2007 11:23:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-coding-standards/m-p/2274930#M494576</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-05-21T11:23:42Z</dc:date>
    </item>
  </channel>
</rss>

