<?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 STATICS versus DATA in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248779#M144409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, folks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Can someone explain me what the difference between STATICS and DATA?&lt;/P&gt;&lt;P&gt;   My doubts is related to performance: memory allocated, acess in internal tables declared like STATICS, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thaks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rafael Soares&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how i can use both of them STATIC and DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My doubt is about best practice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some cases that i mustn't use STATIC variables? In some WEBAS configuration this statement can cause a bad performace?&lt;/P&gt;&lt;P&gt;Some OS doesn't work fine with STATIC variables?&lt;/P&gt;&lt;P&gt;Internal tables declared by STATIC have some problem to read data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rafael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Apr 2006 14:29:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-06T14:29:12Z</dc:date>
    <item>
      <title>STATICS versus DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248779#M144409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, folks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Can someone explain me what the difference between STATICS and DATA?&lt;/P&gt;&lt;P&gt;   My doubts is related to performance: memory allocated, acess in internal tables declared like STATICS, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thaks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rafael Soares&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how i can use both of them STATIC and DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My doubt is about best practice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some cases that i mustn't use STATIC variables? In some WEBAS configuration this statement can cause a bad performace?&lt;/P&gt;&lt;P&gt;Some OS doesn't work fine with STATIC variables?&lt;/P&gt;&lt;P&gt;Internal tables declared by STATIC have some problem to read data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rafael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2006 14:29:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248779#M144409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-06T14:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: STATICS versus DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248780#M144410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;F1 Help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STATICS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple Static Field Definitions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- STATICS f. &lt;/P&gt;&lt;P&gt;- STATICS f(len). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structured Static Data Object Definitions &lt;/P&gt;&lt;P&gt;- STATICS: BEGIN OF struc, &lt;/P&gt;&lt;P&gt;              ... &lt;/P&gt;&lt;P&gt;               END   OF struc. &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;Structured Static Internal Table Definition &lt;/P&gt;&lt;P&gt;- STATICS itab TYPE tabtype [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;- STATICS itab TYPE tabkind OF linetype &lt;/P&gt;&lt;P&gt;             [WITH [UNIQUE|NON-UNIQUE] keydef] &lt;/P&gt;&lt;P&gt;             [INITIAL SIZE n] [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;- STATICS itab LIKE tabkind OF lineobj &lt;/P&gt;&lt;P&gt;            [WITH [UNIQUE|NON-UNIQUE] keydef] &lt;/P&gt;&lt;P&gt;            [INITIAL SIZE n] [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;- STATICS itab TYPE linetype OCCURS n [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;- STATICS itab LIKE lineobj  OCCURS n [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;- STATICS: BEGIN OF itab OCCURS n, &lt;/P&gt;&lt;P&gt;           ... &lt;/P&gt;&lt;P&gt;         END   OF itab [VALID BETWEEN f1 AND f2]. &lt;/P&gt;&lt;P&gt;STATICS itab TYPE RANGE OF type. &lt;/P&gt;&lt;P&gt;STATICS itab LIKE RANGE OF f &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The STATICS statement is a variation of the DATA statement. It allows you todefine variables in a procedure (i.e. a FORM or FUNCTION)with local visibility, but static validity. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement is not allowed in methods. See STATICS not allowed in instancemethods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Local visibility means that static variables, like normal local &lt;/P&gt;&lt;P&gt;variables created with DATA, can be accessed by their name only withinthe defining procedure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static validity means that, unlike normal local variables, thelife of static variables does not depend on the defining procedure, buton the program at runtime. Static variables are thus not redefined onthe stack each time the defining procedure is called, but existindependently of this in the program and keep their value, regardlessof calls to the defining procedure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all other data objects, static variablesalways have a particular data type. Data types and data objects areimportant components of the ABAP typeconcept. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;DATA RESULT TYPE I. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM RANDOM CHANGING RESULT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM RANDOM CHANGING P_RESULT TYPE I. &lt;/P&gt;&lt;P&gt;  STATICS L_STATE TYPE I. &lt;/P&gt;&lt;P&gt;  L_STATE = ( L_STATE * 113 + 34 )  MOD 256. &lt;/P&gt;&lt;P&gt;  P_RESULT = L_STATE. &lt;/P&gt;&lt;P&gt;ENDFORM. &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;&lt;/P&gt;&lt;P&gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regard,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2006 14:31:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248780#M144410</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-04-06T14:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: STATICS versus DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248781#M144411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rafael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A variable declared using STATICS is in memory and the value does not change depending on who is accessing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as DATA is a normal variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2006 14:58:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248781#M144411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-06T14:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: STATICS versus DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248782#M144412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rafael, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Statics means a data definition in a Form-Routine, which is only local visible, but remains when you leave the Form-Routine. I sometimes use it to buffer data, e.g.:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM move_dmbtr USING    p_bukrs TYPE bukrs&lt;/P&gt;&lt;P&gt;                         p_shkzg TYPE shkzg&lt;/P&gt;&lt;P&gt;                         p_dmbtr TYPE dmbtr&lt;/P&gt;&lt;P&gt;                CHANGING p_betrg TYPE  zg6k_s_iprg1-betrg&lt;/P&gt;&lt;P&gt;                         p_waers TYPE  zg6k_s_iprg1-waers&lt;/P&gt;&lt;P&gt;                         p_total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  STATICS: BEGIN OF lwa_t001,&lt;/P&gt;&lt;P&gt;           bukrs TYPE bukrs,&lt;/P&gt;&lt;P&gt;           waers TYPE waers,&lt;/P&gt;&lt;P&gt;           END OF lwa_t001.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Company Code already known  ?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF lwa_t001-bukrs NE p_bukrs.&lt;/P&gt;&lt;P&gt;    CLEAR lwa_t001.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE bukrs waers INTO CORRESPONDING FIELDS  &lt;/P&gt;&lt;P&gt;             OF lwa_t001&lt;/P&gt;&lt;P&gt;             FROM  t001&lt;/P&gt;&lt;P&gt;           WHERE  bukrs  = p_bukrs.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;  p_waers = lwa_t001-waers.&lt;/P&gt;&lt;P&gt;  ENDFORM .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Means, that Table T001 will only be selected, when the company code changes. No problems known so far. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2006 14:58:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248782#M144412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-06T14:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: STATICS versus DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248783#M144413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know how i can use both of them STATIC and DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My doubt is about best practice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some cases that i mustn't use STATIC variables? In some WEBAS configuration this statement can cause a bad performace?&lt;/P&gt;&lt;P&gt;Some OS doesn't work fine with STATIC variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rafael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2006 15:29:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statics-versus-data/m-p/1248783#M144413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-06T15:29:49Z</dc:date>
    </item>
  </channel>
</rss>

