<?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: Calculation error with character type in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579139#M1434079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dkbr1992,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not see your previous thread, no link given.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;just means that the result does not fit in the field. If you declare a character(1) and try to put the result of, say 4+7=11 here, it will display as * because 11 has two characters and the variable has only one.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Feb 2010 10:06:17 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2010-02-19T10:06:17Z</dc:date>
    <item>
      <title>Calculation error with character type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579134#M1434074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good noon everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my previous post I have asked about the problem in displaying 0 in modulepool screen. I overcame it by declaring it as character type, but the problem here is that it is giving wrong result while calculations. It is giving * as the output.&lt;/P&gt;&lt;P&gt;Any ideas which datatype to use so that 0 is displayed in the screen and calculations are possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dev.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 08:37:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579134#M1434074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-19T08:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation error with character type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579135#M1434075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;the + indicates, that your output field is too short. If you defined your field as c, without any length, the default length is 1. So you would be able to display and calculate all 1 digit values. Declare your field like this&lt;/P&gt;&lt;P&gt;data: output(15) type c &lt;/P&gt;&lt;P&gt;or like this &lt;/P&gt;&lt;P&gt;Data: output type char15&lt;/P&gt;&lt;P&gt;then your display field can display up to 15 digits (including all -,.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jörg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 08:47:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579135#M1434075</guid>
      <dc:creator>jrg_wulf</dc:creator>
      <dc:date>2010-02-19T08:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation error with character type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579136#M1434076</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;P&gt;As you have already declared you field as character type, you can do one thing.&lt;/P&gt;&lt;P&gt;Declare anothe variable of type p and copy that screen value which you declared as type c into that and use that for your calculations. And declare your output field also of type p only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 09:01:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579136#M1434076</guid>
      <dc:creator>sridhar_meesala</dc:creator>
      <dc:date>2010-02-19T09:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation error with character type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579137#M1434077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DKBR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to do a small data conversion for this. Just create a fixed point numeric variable like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: p_num(8) type p decimals 2. "Or whatever parameters are suitable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then pass the character field value to this variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_num = character_variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just put in a check before this statement to verify whether all the characters in your character-type variable are actually numerals. This you can do as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: string_num(10) type c value '0123456789'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if character_variable CO string_num. "Contains Only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;proceed&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;throw error&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps! Please revert if you need anything else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Shailesh.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Always provide feedback for helpful answers&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 09:23:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579137#M1434077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-19T09:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation error with character type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579138#M1434078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much Sri.&lt;/P&gt;&lt;P&gt;It worked.&lt;/P&gt;&lt;P&gt;But isn't there any data type that can display 0 and can also be used for calculation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dev.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 10:02:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579138#M1434078</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-19T10:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation error with character type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579139#M1434079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dkbr1992,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not see your previous thread, no link given.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;just means that the result does not fit in the field. If you declare a character(1) and try to put the result of, say 4+7=11 here, it will display as * because 11 has two characters and the variable has only one.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 10:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579139#M1434079</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-02-19T10:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation error with character type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579140#M1434080</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;P&gt;if you are performing calculations on 'char' fields it will show unexpected results or some times may leads to dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do one thing, before displaying the variable(on which you need zeros) move that value(having no zeros-numeric value)&lt;/P&gt;&lt;P&gt;into a variable of type 'NUMC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will works.&lt;/P&gt;&lt;P&gt;then no need to perform on 'char' fields.&lt;/P&gt;&lt;P&gt;move the value to any other type after performing all the calculations. if you move before and perform operations on that new variable you will unexpected values only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope clear right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Sasi Kanth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 10:56:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-error-with-character-type/m-p/6579140#M1434080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-19T10:56:08Z</dc:date>
    </item>
  </channel>
</rss>

