<?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 why do casts from char to packed fields fail? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-casts-from-char-to-packed-fields-fail/m-p/793514#M40247</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i try to assign a quite small value ('-9.123E-123') from a character(255) field into a field type p. but although the string is a number i get a CX_SY_CONVERSION_NO_NUMBER exception. only if i move the value into a float field first the typeconversion works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: var1(255) type c value '-9.123E-123',&lt;/P&gt;&lt;P&gt;      var2      type f,&lt;/P&gt;&lt;P&gt;      var3(7)   type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      var3 = var1. =&amp;gt; CX_SY_CONVERSION_NO_NUMBER&lt;/P&gt;&lt;P&gt;      var3 = var2 = var1. =&amp;gt; works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody know why the types aren't converted correctly and were i can get some additional documentation? the character field is also used for other not number like values and i do not want to use a lot of RTTI to determine the type of the field i assign the value to in my program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;roman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Mar 2004 21:01:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2004-03-19T21:01:18Z</dc:date>
    <item>
      <title>why do casts from char to packed fields fail?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-casts-from-char-to-packed-fields-fail/m-p/793514#M40247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i try to assign a quite small value ('-9.123E-123') from a character(255) field into a field type p. but although the string is a number i get a CX_SY_CONVERSION_NO_NUMBER exception. only if i move the value into a float field first the typeconversion works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: var1(255) type c value '-9.123E-123',&lt;/P&gt;&lt;P&gt;      var2      type f,&lt;/P&gt;&lt;P&gt;      var3(7)   type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      var3 = var1. =&amp;gt; CX_SY_CONVERSION_NO_NUMBER&lt;/P&gt;&lt;P&gt;      var3 = var2 = var1. =&amp;gt; works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody know why the types aren't converted correctly and were i can get some additional documentation? the character field is also used for other not number like values and i do not want to use a lot of RTTI to determine the type of the field i assign the value to in my program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;roman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2004 21:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-casts-from-char-to-packed-fields-fail/m-p/793514#M40247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-03-19T21:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: why do casts from char to packed fields fail?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-casts-from-char-to-packed-fields-fail/m-p/793515#M40248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Packed variables will only allow conversion from character strings like "1234.56-", not even "1,234.56-".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your value is not a packed number but rather a float.  This is why the conversion to packed must go char -&amp;gt; float -&amp;gt; packed, accepting possible truncation and rounding along the way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most type-conversion documentation can be accessed by looking at the help for the MOVE command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Scott Barden&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Mar 2004 13:07:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-casts-from-char-to-packed-fields-fail/m-p/793515#M40248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-03-20T13:07:25Z</dc:date>
    </item>
  </channel>
</rss>

