<?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>Question Re: Variable preceded with exclamation mark in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821006#M261097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Horst.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure there must be some deep cosmological reasoning governing the learning of information and the near-after need for that information.  Similar things seem to happen a lot for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's nice to have you in the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Nov 2004 15:24:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2004-11-10T15:24:14Z</dc:date>
    <item>
      <title>Variable preceded with exclamation mark</title>
      <link>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaq-p/821004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A colleague of mine just noticed something that I have never seen before and can't see the purpose of - preceding a variable with !.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
  mydate TYPE d.

mydate = sy-datum.
ADD 1 TO !mydate.

WRITE: mydate, !mydate.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The memory reference is identical, changing MYDATE changes !MYDATE too.  Works for internal tables too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Odd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2004 13:58:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaq-p/821004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-11-10T13:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Variable preceded with exclamation mark</title>
      <link>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821005#M261096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;! is an escape symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can write ! directly in front of a operand name to distinguish it from the same ABAP word. Each word (except the first one) of an ABAP statement that is preceded by ! is treated as an operand. The escape symbol itself is not part of the name and ignored during execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of ! is normally not required. The ABAP compiler is smart enough to distinguish between ABAP words and operands as in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DATA data TYPE type.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there are rare cases ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;FORM test USING !changing CHANGING !using.&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first ! is required or you get a syntax error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: I found out about that only some weeks ago and now its part of the ABAP documentation &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2004 14:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821005#M261096</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2004-11-10T14:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Variable preceded with exclamation mark</title>
      <link>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821006#M261097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Horst.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure there must be some deep cosmological reasoning governing the learning of information and the near-after need for that information.  Similar things seem to happen a lot for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's nice to have you in the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2004 15:24:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821006#M261097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-11-10T15:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Variable preceded with exclamation mark</title>
      <link>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821007#M261098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cosmological reasoning  is even stronger than you can imagine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Believe it or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exactly in the moment, you were posting the question, I was discussing with my boss about that subject (naming conventions, reserved words, need of ! etc.). When he left my office, I turned to the screen and found your entry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2004 15:29:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821007#M261098</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2004-11-10T15:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Variable preceded with exclamation mark</title>
      <link>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821008#M261099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Horst, &lt;/P&gt;&lt;P&gt;thanks for the information, I was puzzeled once too, but thought it would be an odd programming style.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While I understand the purpose I do not see the requirement. What could be the reason that I would want to name my variable like a key word?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean the maintenance of a program (especially if written by someone else) is not only a question of abap knowledge but requires also to get used to a certain style. &lt;/P&gt;&lt;P&gt;Maybe the compiler is smart enough - I am not. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having established some naming conventions on a rather deep level (types, variables) I would be curious if there is a situation where you do not have a choice but to use that escape symbol. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Nov 2004 08:48:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821008#M261099</guid>
      <dc:creator>ChristianFi</dc:creator>
      <dc:date>2004-11-13T08:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Variable preceded with exclamation mark</title>
      <link>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821009#M261100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from my point of view, you are perfectly right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One should try not to use "reserved ABAP words" at all(even if ABAP doesn't have "reserved words" in a technical sense9. And to be perfectly sure to do so, one must follow some naming conventions because you can never be sure that a unprefixed word, that is not an ABAP word today, will not become an ABAP word in a future release.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is my personal opinion. Officialy, ABAP does not enforce naming conventions and names that are equal to ABAP words are allowed. In some cases like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA i TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this can be okay (different namespaces for types and data objects). But other declarations that lead to  syntactically correct statements like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE TABLE WITH TABLE KEY TABLE = TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should of course be avoided, even if you do not have to use the escape symbol!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, it is the developers own responsibility to keep his or her source code readable. Naming conventions can be a great help, but are no necessity. But in fact there should never be a situation, where you use names that force you to use the escape symbol (introducing ! into above READ TABLE statment is not mandatory but would make it more readable).&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;Horst&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2004 07:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/variable-preceded-with-exclamation-mark/qaa-p/821009#M261100</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2004-11-15T07:42:00Z</dc:date>
    </item>
  </channel>
</rss>

