<?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: get integer values 0 and 1 without using numbers in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334249#M1991763</link>
    <description>&lt;P&gt;Many hundreds of years ago, I was learning to program on my first computer - a ZX81. Memory was limited, so the community worked out ways of conserving it.&lt;/P&gt;&lt;P&gt;A number took maybe 5 bytes. But PI (a keyword) was a constant, with a value encoded in ROM. So for 1 we had PI / PI. And for 0 we had PI - PI. Both of which used less memory. Which is important when you're trying to squeeze 3D Monster Maze into 16K. &lt;/P&gt;&lt;P&gt;From the sublime to the ridiculous&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA zero TYPE i.
DATA(one) = zero - sign( zero - sign( 2 ) ).
SELECT * FROM a_huge_db_table INTO @data(oh_this_is_utterly_ludicrous).
DATA(one) = lines( oh_this_is_utterly_ludicrous ) / lines( oh_this_is_utterly_ludicrous ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Mar 2021 17:47:49 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2021-03-22T17:47:49Z</dc:date>
    <item>
      <title>get integer values 0 and 1 without using numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334246#M1991760</link>
      <description>&lt;P&gt;Hey there,&lt;/P&gt;
  &lt;P&gt;I want to make a program printing the numbers 1 to 100 without using any numbers or loops.&lt;/P&gt;
  &lt;P&gt;I also made a recursive function in ABAP.&lt;/P&gt;
  &lt;P&gt;But i have no clue hot to get 0 and 1 without using numbers in ABAP.&lt;/P&gt;
  &lt;P&gt;May you have an idea?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;//example in Javascript

const one = +true; // This would return 1 (Unary and boolean operator)
const zero = +false; // This would return 0 (Unary and boolean operator)
// Using string operations apending 1 and 0 and 0 to form "100"
const hundredInString = one.toString() + zero.toString() + zero.toString();
// To save the day for not using the loop, we are using recursion

function.const printInRecursion = (index) =&amp;gt; {   
  if (index &amp;lt;= parseInt(hundredInString)) {
    console.log(index);
    printInRecursion(index + one);
  }
  return
}
printInRecursion(parseInt(one))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Mar 2021 15:53:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334246#M1991760</guid>
      <dc:creator>schmelto</dc:creator>
      <dc:date>2021-03-22T15:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: get integer values 0 and 1 without using numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334247#M1991761</link>
      <description>&lt;P&gt;calculate the length of an empty string with STRLEN to get 0.&lt;/P&gt;&lt;P&gt;Edit: You can also take advantage of SY-SUBRC or other system variables.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 16:05:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334247#M1991761</guid>
      <dc:creator>former_member736527</dc:creator>
      <dc:date>2021-03-22T16:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: get integer values 0 and 1 without using numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334248#M1991762</link>
      <description>&lt;P&gt;Cool, that sounds like fun! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How about something that counts something, would that be ok... like strlen?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(zero) = strlen( '' ).
DATA(one) = strlen( 'a' ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Mar 2021 16:06:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334248#M1991762</guid>
      <dc:creator>joltdx</dc:creator>
      <dc:date>2021-03-22T16:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: get integer values 0 and 1 without using numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334249#M1991763</link>
      <description>&lt;P&gt;Many hundreds of years ago, I was learning to program on my first computer - a ZX81. Memory was limited, so the community worked out ways of conserving it.&lt;/P&gt;&lt;P&gt;A number took maybe 5 bytes. But PI (a keyword) was a constant, with a value encoded in ROM. So for 1 we had PI / PI. And for 0 we had PI - PI. Both of which used less memory. Which is important when you're trying to squeeze 3D Monster Maze into 16K. &lt;/P&gt;&lt;P&gt;From the sublime to the ridiculous&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA zero TYPE i.
DATA(one) = zero - sign( zero - sign( 2 ) ).
SELECT * FROM a_huge_db_table INTO @data(oh_this_is_utterly_ludicrous).
DATA(one) = lines( oh_this_is_utterly_ludicrous ) / lines( oh_this_is_utterly_ludicrous ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Mar 2021 17:47:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334249#M1991763</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-03-22T17:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: get integer values 0 and 1 without using numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334250#M1991764</link>
      <description>&lt;P&gt;Bonus points if you know where "Oh, this is utterly ludicrous" comes from.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 18:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334250#M1991764</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-03-22T18:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: get integer values 0 and 1 without using numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334251#M1991765</link>
      <description>&lt;P&gt;Excellent.&lt;/P&gt;&lt;P&gt;Ask Basis to set up instance 001.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(one) = sy-sysid.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Mar 2021 18:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334251#M1991765</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-03-22T18:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: get integer values 0 and 1 without using numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334252#M1991766</link>
      <description>&lt;P&gt;Function &lt;STRONG&gt;distance()&lt;/STRONG&gt; was created for that&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(zero) = distance( val1 = abap_true val2 = abap_true ).
DATA(one)  = distance( val1 = abap_true val2 = abap_false ).


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Mar 2021 21:34:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-integer-values-0-and-1-without-using-numbers/m-p/12334252#M1991766</guid>
      <dc:creator>touzik_itc</dc:creator>
      <dc:date>2021-03-29T21:34:01Z</dc:date>
    </item>
  </channel>
</rss>

