<?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: How does CONSTANTS in a subroutine differs from STATICS variables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439549#M825991</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;example given in SAP Keyword hlp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO 10 TIMES. 
  PERFORM add_one. 
ENDDO. 

FORM add_one. 
  DATA    local  TYPE i VALUE 0. 
  STATICS static TYPE i VALUE 0. 
  local  = local  + 1. 
  static = static + 1. 
  WRITE: / local, static. 
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;         1           1
         1           2
         1           3
         1           4
         1           5
         1           6
         1           7
         1           8
         1           9
         1          10&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Feb 2008 06:51:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-09T06:51:42Z</dc:date>
    <item>
      <title>How does CONSTANTS in a subroutine differs from STATICS variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439544#M825986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How does CONSTANTS in a subroutine differs from STATICS variables in a subroutine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 06:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439544#M825986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-09T06:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: How does CONSTANTS in a subroutine differs from STATICS variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439545#M825987</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 simple words &lt;STRONG&gt;statics&lt;/STRONG&gt; is used declare variable inside a sub-routine whose life dosen't end when the subroutine ends..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the foll code will explain more......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data f value 1.
PERFORM hello.
f = 2.
PERFORM hello.

FORM hello.
  DATA    a(30).
  STATICS b(30).
  if f = 1.
  move : 'local bcoz  declared as data' to a,
         'global bcoz declared as static' to b.
  else.
  write /.
  endif.
  write: / 'call no = ',f,'     a = ',a,'b = ',b.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;jose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: jose on Feb 9, 2008 7:34 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 06:26:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439545#M825987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-09T06:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How does CONSTANTS in a subroutine differs from STATICS variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439546#M825988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I do not have a system now &lt;DEL&gt;could you give me the output&lt;/DEL&gt;- pls&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 06:38:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439546#M825988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-09T06:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: How does CONSTANTS in a subroutine differs from STATICS variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439547#M825989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call no =  1      a =  local bcoz  declared as data   b =  global bcoz declared as static

call no =  2      a =                                 b =  global bcoz declared as static&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the second call variable &lt;STRONG&gt;a&lt;/STRONG&gt;(declared as data) got initialized but variable &lt;STRONG&gt;b&lt;/STRONG&gt;(declared as statics) has the previous value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 06:41:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439547#M825989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-09T06:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: How does CONSTANTS in a subroutine differs from STATICS variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439548#M825990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks jose points will follow  do not worry I am just waiting for more answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 06:45:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439548#M825990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-09T06:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: How does CONSTANTS in a subroutine differs from STATICS variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439549#M825991</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;example given in SAP Keyword hlp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO 10 TIMES. 
  PERFORM add_one. 
ENDDO. 

FORM add_one. 
  DATA    local  TYPE i VALUE 0. 
  STATICS static TYPE i VALUE 0. 
  local  = local  + 1. 
  static = static + 1. 
  WRITE: / local, static. 
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;         1           1
         1           2
         1           3
         1           4
         1           5
         1           6
         1           7
         1           8
         1           9
         1          10&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 06:51:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439549#M825991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-09T06:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: How does CONSTANTS in a subroutine differs from STATICS variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439550#M825992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;great help indeed&lt;/P&gt;&lt;P&gt;2 eg.,s  r good&lt;/P&gt;&lt;P&gt;abaper.learner&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 07:01:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-does-constants-in-a-subroutine-differs-from-statics-variables/m-p/3439550#M825992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-09T07:01:34Z</dc:date>
    </item>
  </channel>
</rss>

