<?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: DEC TO BIN in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583074#M1273162</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the following codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Parameter: P_source type p decimals 2.
data: w_int type i,
      w_char type c,
      w_result(16) type c.
  
WHILE P_SOURC GE 1.

    W_INT = P_SOURC MOD 2.
    P_SOURC = P_SOURC DIV 2.
    W_CHAR = W_INT .
    CONCATENATE  W_CHAR W_RESULT  INTO W_RESULT .

  ENDWHILE.                            "WHILE P_SOURC GE 1 .
  WRITE :/ 'BINARY EQUIVALENT:',W_RESULT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 May 2009 14:52:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-05T14:52:56Z</dc:date>
    <item>
      <title>DEC TO BIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583071#M1273159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anybody knows a FM to convert a decimal number into a binary number?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 14:24:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583071#M1273159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T14:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: DEC TO BIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583072#M1273160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this fm &lt;/P&gt;&lt;P&gt;FITP_UTIL_CONVERT_DEC2HEX&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 14:37:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583072#M1273160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T14:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: DEC TO BIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583073#M1273161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx, but, I need something more directly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;importing parameter - the decimal number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exporting parameter - the binary number written on a char with 16 positions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 14:44:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583073#M1273161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T14:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: DEC TO BIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583074#M1273162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the following codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Parameter: P_source type p decimals 2.
data: w_int type i,
      w_char type c,
      w_result(16) type c.
  
WHILE P_SOURC GE 1.

    W_INT = P_SOURC MOD 2.
    P_SOURC = P_SOURC DIV 2.
    W_CHAR = W_INT .
    CONCATENATE  W_CHAR W_RESULT  INTO W_RESULT .

  ENDWHILE.                            "WHILE P_SOURC GE 1 .
  WRITE :/ 'BINARY EQUIVALENT:',W_RESULT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 14:52:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583074#M1273162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: DEC TO BIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583075#M1273163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know it it exists, but I think this should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  Z_TEST_MONTORI.

DATA the_number TYPE i VALUE 15.
DATA the_original_number TYPE i.
DATA the_rest TYPE i.
DATA the_bit TYPE string.
DATA the_binary TYPE string.
" before start store original number
the_original_number = the_number.
" simple binary conversion
DO.
  " put MOD of division by two in head of binary result
  the_rest = the_number MOD 2.
  the_number = the_number DIV 2.
  " convert to string for concatenating
  the_bit = the_rest.
  CONCATENATE the_binary the_bit INTO the_binary.
  IF the_number EQ 0.
    EXIT.
  ENDIF.
ENDDO.
WRITE : the_original_number, 'in binary is ', the_binary.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Gabriele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 15:02:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583075#M1273163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T15:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: DEC TO BIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583076#M1273164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurpreet,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good code &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;) I was thinking of the same logic but did not put it into ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 15:04:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dec-to-bin/m-p/5583076#M1273164</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-05-05T15:04:34Z</dc:date>
    </item>
  </channel>
</rss>

