<?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: constants in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599314#M269093</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can i declare constants for list heading like name date time if so how&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Oct 2006 06:54:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-18T06:54:14Z</dc:date>
    <item>
      <title>constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599310#M269089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to declare constants in the program&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 06:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599310#M269089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T06:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599311#M269090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;constants: c_value(1) value '1'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 06:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599311#M269090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T06:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599312#M269091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;constants : c_var type (give any datatype) value '(give a constant value)'.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shrita.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: shrita sharma&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 06:26:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599312#M269091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T06:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599313#M269092</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;Go thru this Docu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;CONSTANTS const [options]. &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;This statement declares a constant data object - that is, a constant const. The content of a constant cannot be changed at runtime of an ABAP program. You can only use it as an operands in read positions of ABAP statements. Constants that you declare in the declaration section of a class or an interface belong to static attributes of that class/interface. &lt;/P&gt;&lt;P&gt;The name conventions apply to the name const. The syntax of the additions options of the CONSTANTS statement, for declaring constants, corresponds to that of the DATA statement for declaring variables. The only differences are that the READ-ONLY addition is not possible and within the declaration of a structure, the INCLUDE statement cannot be used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In contrast to the DATA statement, you have to specify an Startwert with the addition VALUE using the CONSTANTS statement. The same restrictions as for the DATA statement apply. This has the following implications for the declaration of constants: &lt;/P&gt;&lt;P&gt;You cannot declare any constants with a deep data type prior to release 6.10. As of release 6.10 and later, you can also declare deep constants, but you can only specify a start value val for ABAP type string. To assign an initial values to the other deep constants, you have to use IS INITIAL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constant internal tables are always empty, and prior to release 6.40, you can only declare them by referring to an existing table type and you cannot declare any new bound table types (see under DATA - TABLE OF), because you cannot use the addition VALUE in this case. As of release 6.40, the VALUE addition can also be specified when defining internal tables. Therefore, you can create new bound table types using the CONSTANTS statement. &lt;/P&gt;&lt;P&gt;&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;If you use the class component selector, you can also use the interface name to access static attributes of interfaces that were declared using CONSTANTS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The statements below declare a numeric constant, a constant structure and a constant reference. You can use the reference in comparisons, for example, or pass it on to procedures. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS pi(8) TYPE p DECIMALS 14 &lt;/P&gt;&lt;P&gt;                 VALUE '3.14159265358979'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS: BEGIN OF sap_ag, &lt;/P&gt;&lt;P&gt;             zip_code(5) TYPE n VALUE '69189', &lt;/P&gt;&lt;P&gt;             city TYPE string VALUE `Walldorf`, &lt;/P&gt;&lt;P&gt;             country TYPE string VALUE `Germany`, &lt;/P&gt;&lt;P&gt;           END OF sap_ag. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS null_pointer TYPE REF TO object VALUE IS INITIAL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sunil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 06:49:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599313#M269092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T06:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599314#M269093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can i declare constants for list heading like name date time if so how&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 06:54:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599314#M269093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T06:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599315#M269094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Elementary constants:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS: pi     TYPE p DECIMALS 10 VALUE '3.1415926536'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           ref_c1 TYPE REF TO C1 VALUE IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last line shows how you can use the IS INITIAL argument in the VALUEaddition. Since you must use the VALUE addition in the CONSTANTS statement, this is the only way to assign an initial value to a constant when you declare it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Complex constants:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS: BEGIN OF myaddress,&lt;/P&gt;&lt;P&gt;           name     TYPE c LENGTH 20 VALUE 'Fred Flintstone',&lt;/P&gt;&lt;P&gt;           street   TYPE c LENGTH 20 VALUE 'Cave Avenue',&lt;/P&gt;&lt;P&gt;           number   TYPE p           VALUE  11,&lt;/P&gt;&lt;P&gt;           postcode TYPE n LENGTH 5  VALUE  98765,&lt;/P&gt;&lt;P&gt;           city     TYPE c LENGTH 20 VALUE  'Bedrock',&lt;/P&gt;&lt;P&gt;           END OF myaddress.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This declares a constant structure myaddress. The components can be addressed by myaddress-name, myaddress-street, and so on, but they cannot be changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constants are named data objects that you create statically using a declarative statement. They allow you to store data under a particular name within the memory area of a program. The value of a constant must be defined when you declare it. It cannot subsequently be changed. The value of a constant cannot be changed during the execution of the program. If you try to change the value of a constant, a syntax error or runtime error occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You declare constants using the CONSTANTS statement. Within the program, you can also declare local variables within procedures using CONSTANTS. The same rules of visibility apply to constants as apply to the visibility of data types. Local constants in procedures obscure identically-named variables in the main program. Constants exist for as long as the context in which they are declared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax of the CONSTANTS statement is exactly the same as that of the DATA statement, but with the following exceptions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        You must use the VALUE addition in the CONSTANTS statement. The start value specified in the VALUE addition cannot be changed during the execution of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        You cannot define constants for XSTRINGS, references, internal tables, or structures containing internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 06:55:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599315#M269094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T06:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599316#M269095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create text elements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just for ex :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-field = text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;- Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 06:56:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599316#M269095</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2006-10-18T06:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599317#M269096</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;It is always a good practise to write keywork in ABAP editor and press F1.&lt;/P&gt;&lt;P&gt;This will give SAP Documenatation with example.&lt;/P&gt;&lt;P&gt;This will help you in future in any case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your current case ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type CONSTANTS and press F1 on that.&lt;/P&gt;&lt;P&gt;Check whether it satisfies your doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Please mark all informative responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 07:06:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599317#M269096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T07:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599318#M269097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants : c_var &amp;lt;b&amp;gt;type&amp;lt;/b&amp;gt; (give any datatype) &amp;lt;b&amp;gt;value&amp;lt;/b&amp;gt; '(give a constant value)'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example,  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- date type sy-datum value '20061018'.&lt;/P&gt;&lt;P&gt;- int type i value 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shehryar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 07:47:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599318#M269097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T07:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: constants</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599319#M269098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can do that but the best practise would be to use the List headings option under the menu &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goto -&amp;gt; Text Elements -&amp;gt; List Headings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that does not suit your requirement use Text Elements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 08:20:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants/m-p/1599319#M269098</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T08:20:59Z</dc:date>
    </item>
  </channel>
</rss>

