<?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 use in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants-use/m-p/2828587#M661894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;To declare a Constant Value we use constants&lt;/P&gt;&lt;P&gt;CONSTANTS: c_vbtyp type vbtyp value 'C'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln vbtyp audat from vbak&lt;/P&gt;&lt;P&gt;where vbtyp = c_vbtyp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will fetch the records where vbtyp  = C (orders)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Oct 2007 18:56:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-05T18:56:59Z</dc:date>
    <item>
      <title>constants use</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants-use/m-p/2828586#M661893</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;when we use constants???&lt;/P&gt;&lt;P&gt;can anyone explain with example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 18:51:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants-use/m-p/2828586#M661893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T18:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: constants use</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants-use/m-p/2828587#M661894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;To declare a Constant Value we use constants&lt;/P&gt;&lt;P&gt;CONSTANTS: c_vbtyp type vbtyp value 'C'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln vbtyp audat from vbak&lt;/P&gt;&lt;P&gt;where vbtyp = c_vbtyp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will fetch the records where vbtyp  = C (orders)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 18:56:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants-use/m-p/2828587#M661894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T18:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: constants use</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constants-use/m-p/2828588#M661895</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 are used in place of hardcoded values.&lt;/P&gt;&lt;P&gt;Take for example, you are using a value '123' in a lot of places in your program.&lt;/P&gt;&lt;P&gt;Later you want to change them to '456'.&lt;/P&gt;&lt;P&gt;It is a problem for you to change each and evry occurance of '123' with '456'.&lt;/P&gt;&lt;P&gt;Hence you declare a constant which is declared globally.&lt;/P&gt;&lt;P&gt;Ther you can simply change it at definition level. It would reflect in all other locations where it is used.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;Constants: c_value(5) type c value '12345'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The constant is a constant so a variable having a value can't be changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The constant are often created to became the program more clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose you want to read the first 100 records of an internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANT MAX_RECORDS TYPE I VALUE 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;    READ TABLE ITAB INDEX SY-INDEX.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Stop the reading if the table has less than 100 record    &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0. EXIT. ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Stop the reading if the record 100 was read&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF SY-INDEX = MAX_RECORDS.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way it's easier to understand the meanining of the control to exit from the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 19:03:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constants-use/m-p/2828588#M661895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T19:03:40Z</dc:date>
    </item>
  </channel>
</rss>

