<?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: counting the comments in the source code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151619#M749503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sailaja,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for your reply.can you explain it futher with an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sravanthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Dec 2007 10:16:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-27T10:16:16Z</dc:date>
    <item>
      <title>counting the comments in the source code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151617#M749501</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;I have a scenario where i need to count the number of comment lines in the source code.can anyone help me regarding this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sravanthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:54:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151617#M749501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: counting the comments in the source code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151618#M749502</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;Make use of 'Scan' statement to get the number of lines with out comments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SCAN ABAP-SOURCE itab1 ...TOKENS INTO itab2 &lt;/P&gt;&lt;P&gt;                       ...STATEMENTS INTO itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP-SOURCE is the program name &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the statement 'With comments'  and without it and do a computation to get the number of commented lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sailaja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 09:59:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151618#M749502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T09:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: counting the comments in the source code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151619#M749503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sailaja,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for your reply.can you explain it futher with an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sravanthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 10:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151619#M749503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T10:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: counting the comments in the source code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151620#M749504</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;Check below Code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZCOMMENT.&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This program subtracts the comment lines from a program source.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To get the line numbers right, run pp before the subtraction.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;It can be useful to document abap developments&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;PARAMETERS: PROGRAM LIKE SY-REPID DEFAULT SY-REPID.&lt;/P&gt;&lt;P&gt;DATA :  BEGIN OF SOURCE OCCURS 1000,&lt;/P&gt;&lt;P&gt;     LINE(72),&lt;/P&gt;&lt;P&gt;END OF SOURCE.&lt;/P&gt;&lt;P&gt;DATA: I TYPE I, J TYPE I, K TYPE I, L TYPE I, LNUM(6) TYPE N.&lt;/P&gt;&lt;P&gt;DATA: EMPTY(72) VALUE&lt;/P&gt;&lt;P&gt;'&lt;/P&gt;&lt;P&gt; '.                                    "Some ugly long line&lt;/P&gt;&lt;P&gt;DATA: P_STATEMENTS LIKE SSTMNT OCCURS 100 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: P_TOKENS LIKE STOKEN OCCURS 100 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;READ REPORT PROGRAM INTO SOURCE.&lt;/P&gt;&lt;P&gt;SCAN ABAP-SOURCE SOURCE STATEMENTS INTO P_STATEMENTS  "Comment in chain&lt;/P&gt;&lt;P&gt;                        TOKENS       INTO P_TOKENS.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Remove the statement closing characters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT P_STATEMENTS.&lt;/P&gt;&lt;P&gt;  IF P_STATEMENTS-TROW &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    READ TABLE SOURCE INDEX P_STATEMENTS-TROW.&lt;/P&gt;&lt;P&gt;    SOURCE+P_STATEMENTS-TCOL(1) = ' '.&lt;/P&gt;&lt;P&gt;    MODIFY SOURCE INDEX P_STATEMENTS-TROW.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Remove the tokens&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT P_TOKENS.&lt;/P&gt;&lt;P&gt;  I = P_TOKENS-ROW.&lt;/P&gt;&lt;P&gt;  J = P_TOKENS-COL.&lt;/P&gt;&lt;P&gt;  K = P_TOKENS-LEN - 1.&lt;/P&gt;&lt;P&gt;  L = J + K.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    READ TABLE SOURCE INDEX I.&lt;/P&gt;&lt;P&gt;    IF L &amp;gt; 72.                         "Multi line token&lt;/P&gt;&lt;P&gt;      L = L - 72.&lt;/P&gt;&lt;P&gt;      SOURCE+J(72) = EMPTY.&lt;/P&gt;&lt;P&gt;      MODIFY SOURCE INDEX I.&lt;/P&gt;&lt;P&gt;      I = I + 1.&lt;/P&gt;&lt;P&gt;      K = L. J = 0.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      IF L &amp;lt; 72.&lt;/P&gt;&lt;P&gt;        K = K + 1.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      SOURCE+J(K) = EMPTY.&lt;/P&gt;&lt;P&gt;      MODIFY SOURCE INDEX I.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Remove ':' (chain statements)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT SOURCE.&lt;/P&gt;&lt;P&gt;  CONDENSE SOURCE NO-GAPS.&lt;/P&gt;&lt;P&gt;  IF SOURCE(1) = ':'.&lt;/P&gt;&lt;P&gt;    DELETE SOURCE.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Print the result&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;FORMAT INPUT ON.&lt;/P&gt;&lt;P&gt;LOOP AT SOURCE.&lt;/P&gt;&lt;P&gt;  LNUM = LNUM + 10.&lt;/P&gt;&lt;P&gt;  IF NOT SOURCE IS INITIAL.&lt;/P&gt;&lt;P&gt;    FORMAT INTENSIFIED OFF.FORMAT INVERSE OFF.&lt;/P&gt;&lt;P&gt;    TRANSLATE LNUM USING ' 0'.&lt;/P&gt;&lt;P&gt;    WRITE /(6) LNUM COLOR 2.&lt;/P&gt;&lt;P&gt;    IF SOURCE(1) = '*'.&lt;/P&gt;&lt;P&gt;      FORMAT INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;      WRITE 8 SOURCE COLOR 6.&lt;/P&gt;&lt;P&gt;      FORMAT INTENSIFIED OFF.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      WRITE 8 SOURCE COLOR 2.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&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;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 10:34:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151620#M749504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T10:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: counting the comments in the source code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151621#M749505</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;&lt;/P&gt;&lt;P&gt;READ REPORT 'ZDACORPRICERECEIPTS_PRODUCTION' INTO tbl_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BREAK-POINT.&lt;/P&gt;&lt;P&gt;SCAN ABAP-SOURCE tbl_data&lt;/P&gt;&lt;P&gt;     TOKENS      INTO tbl_tk&lt;/P&gt;&lt;P&gt;     STATEMENTS  INTO tbl_stm&lt;/P&gt;&lt;P&gt;     KEYWORDS    FROM tbl_kw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in sap documentation thru tcode saphelp we can see the following. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SCAN ABAP-SOURCE itab1 ... TOKENS INTO itab2 &lt;/P&gt;&lt;P&gt;                       ...STATEMENTS INTO itab3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... WITH COMMENTS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Returns comments also, with each individual comment representing a token. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The addition ... WITH COMMENTS is unfortunately not supported at present! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Sivaparvathi&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>Thu, 27 Dec 2007 11:07:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-the-comments-in-the-source-code/m-p/3151621#M749505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T11:07:05Z</dc:date>
    </item>
  </channel>
</rss>

