<?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 Data Objects for Truth and False Values in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-objects-for-truth-and-false-values/m-p/700855#M31904</link>
    <description>&lt;P&gt;Hello Experts,&lt;BR /&gt;as I know :&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt; abap_true of value “X”&lt;/LI&gt;
   &lt;LI&gt; abap_false of value ” “&lt;/LI&gt;
   &lt;LI&gt; abap_undefined of value “-“.&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;&lt;BR /&gt;But I don't know when we have to use them and which benefits they bring along, but today I have seen them in some coding like below as I think&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;TYPE-POOLS: abap.
DATA:
  lv_flag TYPE abap_bool value abap_false

  IF lv_flag EQ 'X'.
...
  ELSEIF lv_flag IS INITIAL.
...
  ENDIF.

  IF lv_flag EQ abap_true.
...
  ELSEIF lv_flag EQ abap_false.
...
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;can some when explaining to me the difference and the using of them with some&lt;/P&gt;
  &lt;P&gt;examples as why we do not write directly the loops.&lt;/P&gt;
  &lt;P&gt;Best Regards&lt;/P&gt;
  &lt;P&gt;Jenie&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2018 08:14:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-08-08T08:14:44Z</dc:date>
    <item>
      <title>Data Objects for Truth and False Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-objects-for-truth-and-false-values/m-p/700855#M31904</link>
      <description>&lt;P&gt;Hello Experts,&lt;BR /&gt;as I know :&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt; abap_true of value “X”&lt;/LI&gt;
   &lt;LI&gt; abap_false of value ” “&lt;/LI&gt;
   &lt;LI&gt; abap_undefined of value “-“.&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;&lt;BR /&gt;But I don't know when we have to use them and which benefits they bring along, but today I have seen them in some coding like below as I think&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;TYPE-POOLS: abap.
DATA:
  lv_flag TYPE abap_bool value abap_false

  IF lv_flag EQ 'X'.
...
  ELSEIF lv_flag IS INITIAL.
...
  ENDIF.

  IF lv_flag EQ abap_true.
...
  ELSEIF lv_flag EQ abap_false.
...
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;can some when explaining to me the difference and the using of them with some&lt;/P&gt;
  &lt;P&gt;examples as why we do not write directly the loops.&lt;/P&gt;
  &lt;P&gt;Best Regards&lt;/P&gt;
  &lt;P&gt;Jenie&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 08:14:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-objects-for-truth-and-false-values/m-p/700855#M31904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-08-08T08:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data Objects for Truth and False Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-objects-for-truth-and-false-values/m-p/700856#M31905</link>
      <description>&lt;P&gt;It's to do with clarity of meaning - semantics. &lt;STRONG&gt;lv_flag &lt;/STRONG&gt;is a bad name for the variable. Let's say it's used to indicate whether a report is run in test, or whether it does updates. You could then have something like this.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;IF lv_flag EQ 'X'.
  " Write result to screen.
ELSE.
  " Write result to database
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Compare with this, where I've replaced &lt;STRONG&gt;lv_flag &lt;/STRONG&gt;with a meaningfully named variable, and I'm using &lt;STRONG&gt;abap_true&lt;/STRONG&gt;.:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;IF in_test_mode EQ abap_true.
  " Write result to screen.
ELSE.
  " Write result to database
ENDIF.
 &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;The second example is much more readable. You know exactly what is happening.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Generally speaking, for fixed values, it's better to use meaningful constants. In ABAP &lt;STRONG&gt;abap_true&lt;/STRONG&gt; and &lt;STRONG&gt;abap_false&lt;/STRONG&gt; are supplied for this purpose. In later versions of ABAP, you don't even need to use the &lt;STRONG&gt;TYPE-POOLS:abap.&lt;/STRONG&gt; statement.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 08:53:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-objects-for-truth-and-false-values/m-p/700856#M31905</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-08-08T08:53:20Z</dc:date>
    </item>
  </channel>
</rss>

