<?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: Boolean statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673337#M297360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Anyi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no boolean type defined in ABAP like any other language. &lt;/P&gt;&lt;P&gt;Boolean hold the value true or false - all those cases where you need to check you can use if else statement. ie&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if (Condition1 is true)
 //code....111
else.
 //code...222
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is the way to handle the use of boolean in ABAP. Actually ABAP does not need boolean datatype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Nov 2006 15:00:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-16T15:00:10Z</dc:date>
    <item>
      <title>Boolean statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673332#M297355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am wondering how do you write a boolean statment in ABAP. I tried to do something like this below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
bool = text1 IS initial OR text2 IS initial.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where text1 and text2 are text boxes in the selection screen.&lt;/P&gt;&lt;P&gt;And I ended up having error like this:&lt;/P&gt;&lt;P&gt;Incorrect arithmetic or bit expression: Instead of "IS", an operator (+, -, *, /, ... or BIT-AND, BIT-XOR, BIT-OR) was expected.		&lt;/P&gt;&lt;P&gt;What is wrong with the statement above? Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anyi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 14:42:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673332#M297355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T14:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673333#M297356</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;PRE&gt;&lt;CODE&gt;IF TEXT1 IS INITIAL OR
    TEXT2 IS INITIAL.
* Do something
ENDIF&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 14:47:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673333#M297356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T14:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673334#M297357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hullo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IIRC there is no such thing as a boolean in ABAP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you can solve this using an IF statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: bool(1) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF text1 IS INITIAL OR text2 IS INITIAL.
  bool = 'T'  .
ELSE.
  bool = 'F'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where the values 'T' stands for true and 'F' stands for false. (Usually in ABAP the value for true is 'X' and ' ' for false though).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 14:49:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673334#M297357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T14:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673335#M297358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if text1 is initial or &lt;/P&gt;&lt;P&gt;   text2 is inital.&lt;/P&gt;&lt;P&gt;ensid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 14:50:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673335#M297358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T14:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673336#M297359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Really there is no boolean in ABAP, it is just a TYPE C field with either an "X" or a SPACE.  But you can write something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

type-pools: abap.

constants: true type abap_bool value 'X'.
constants: false type abap_bool value ' '.

data:  value type c.


if value = true.

elseif value = false.

endif.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 14:57:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673336#M297359</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-16T14:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673337#M297360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Anyi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no boolean type defined in ABAP like any other language. &lt;/P&gt;&lt;P&gt;Boolean hold the value true or false - all those cases where you need to check you can use if else statement. ie&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if (Condition1 is true)
 //code....111
else.
 //code...222
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is the way to handle the use of boolean in ABAP. Actually ABAP does not need boolean datatype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 15:00:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/boolean-statement/m-p/1673337#M297360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T15:00:10Z</dc:date>
    </item>
  </channel>
</rss>

