<?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: Declaring a variable with a non fixed decimal. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386241#M1403938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to create dynamic variable.&lt;/P&gt;&lt;P&gt;like this &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA lv_test TYPE REF TO data.
FIELD-SYMBOLS &amp;lt;X&amp;gt; TYPE ANY.

DATA: lv_deci TYPE i VALUE 2.
CREATE DATA lv_test TYPE p DECIMALS lv_deci.
ASSIGN lv_test-&amp;gt;* TO &amp;lt;X&amp;gt;.
&amp;lt;X&amp;gt; = '20.333'.  "Anything.
WRITE: &amp;lt;fs&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please search CREATE DATA in F1 for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chaiphon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Dec 2009 04:15:19 GMT</pubDate>
    <dc:creator>chaiphon</dc:creator>
    <dc:date>2009-12-03T04:15:19Z</dc:date>
    <item>
      <title>Declaring a variable with a non fixed decimal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386239#M1403936</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;There is a request to follow the number of decimal places from table TCURX depending on the country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_decimal type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single decimal&lt;/P&gt;&lt;P&gt;into l_decimal &lt;/P&gt;&lt;P&gt;where waers eq itab-waers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: X type p decimal l_decimal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X = 5.32424  x 3.2452542 / 2.3242352&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The declaration of the variable with the decimal using another variable is not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any other suggestions on doing this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2009 02:54:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386239#M1403936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-03T02:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Declaring a variable with a non fixed decimal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386240#M1403937</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;for dynamic declaration always use () brackets&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is :&lt;/P&gt;&lt;P&gt;data: X type p decimal l_decimal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: X type p decimal (l_decimal).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try This trick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards&lt;/P&gt;&lt;P&gt;Anand kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2009 04:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386240#M1403937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-03T04:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Declaring a variable with a non fixed decimal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386241#M1403938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to create dynamic variable.&lt;/P&gt;&lt;P&gt;like this &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA lv_test TYPE REF TO data.
FIELD-SYMBOLS &amp;lt;X&amp;gt; TYPE ANY.

DATA: lv_deci TYPE i VALUE 2.
CREATE DATA lv_test TYPE p DECIMALS lv_deci.
ASSIGN lv_test-&amp;gt;* TO &amp;lt;X&amp;gt;.
&amp;lt;X&amp;gt; = '20.333'.  "Anything.
WRITE: &amp;lt;fs&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please search CREATE DATA in F1 for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chaiphon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2009 04:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386241#M1403938</guid>
      <dc:creator>chaiphon</dc:creator>
      <dc:date>2009-12-03T04:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Declaring a variable with a non fixed decimal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386242#M1403939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chaiphon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot your solution worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anand,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even assigning  the decimal with a variable, it still displays an error of (VAR) is not numeric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2009 05:15:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declaring-a-variable-with-a-non-fixed-decimal/m-p/6386242#M1403939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-03T05:15:14Z</dc:date>
    </item>
  </channel>
</rss>

