<?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: Create data dynamic  issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047040#M1611438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends on what your requirements are, but you have to keep in mind that the maximu length of P data type is 16 btyes.&lt;/P&gt;&lt;P&gt;It should be enough for basic calculations, distances, amounts and so forth...&lt;/P&gt;&lt;P&gt;If precision is required then you''l have to go for the F type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Aug 2011 15:35:08 GMT</pubDate>
    <dc:creator>former_member209703</dc:creator>
    <dc:date>2011-08-09T15:35:08Z</dc:date>
    <item>
      <title>Create data dynamic  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047039#M1611437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating field types dynamically using the following code  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE DATA lv_field_type TYPE (ls_abap_field_desc-type) LENGTH ls_prop-length.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I add the decimals like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE DATA lv_field_type TYPE (ls_abap_field_desc-type) LENGTH ls_prop-length 
            DECIMALS ls_prop-dec.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;i get the following error :&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;+You cannot use the "DECIMALS" addition with a dynamic type declaration.		+&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Use a static type declaration with the type "P" instead.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I add the following line 		&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE DATA lv_field_type TYPE p LENGTH ls_prop-length  DECIMALS ls_prop-dec.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the issue is that I'm not sure if type P is &lt;STRONG&gt;cover all the case's&lt;/STRONG&gt; of decimal fields types.&lt;/P&gt;&lt;P&gt;Any idea how to overcome this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Joy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Joy Stpr on Aug 9, 2011 5:27 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 14:23:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047039#M1611437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-09T14:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create data dynamic  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047040#M1611438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends on what your requirements are, but you have to keep in mind that the maximu length of P data type is 16 btyes.&lt;/P&gt;&lt;P&gt;It should be enough for basic calculations, distances, amounts and so forth...&lt;/P&gt;&lt;P&gt;If precision is required then you''l have to go for the F type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 15:35:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047040#M1611438</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-08-09T15:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create data dynamic  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047041#M1611439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Joy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Decimal field types you see in the ABAP dictionary for e.g., DEC, CURR, QUAN are derived from &lt;EM&gt;packed&lt;/EM&gt; numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For e.g., let us consider the data element WRBTR(CURR 13,2). So it is equivalent to TYPE p LENGTH (13+1)/2 = 7 DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value range of TYPE p LENGTH 7 DECIMALS 2 is (9,999,999,999.99 to 9,999,999,999.99). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we have 12 digits * 0.5 byte = 6 bytes + 0.5 byte for decimal p0int + 0.5 byte for sign(+/-) = 7 bytes. I hope you're clear &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NB: In packed numbers 1 digit occupies 4 bits = 0.5 bytes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll suggest you read the SAP documentation on Predefined Data Types for further info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: SAP does not recommend DEC, QUAN, CURR fields to have "even" lengths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Aug 9, 2011 9:56 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 16:19:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047041#M1611439</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-08-09T16:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create data dynamic  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047042#M1611440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Suhas Saha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the Detailed answer!&lt;/P&gt;&lt;P&gt;I want to verify it ,does the fields with decimal can be just type P  ? or there is another type for decimal ?&lt;/P&gt;&lt;P&gt;I ask it because when i try to create data for any other field with Dec i get error ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Joy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Joy Stpr on Aug 9, 2011 9:48 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 19:13:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047042#M1611440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-09T19:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create data dynamic  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047043#M1611441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I want to verify it ,does the fields with decimal can be just type P  ? or there is another type for decimal ?&lt;/P&gt;&lt;P&gt;&amp;gt; I ask it because when i try to create data for any other field with Dec i get error ....&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per SAP documentation i quote &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;For all other ABAP types and for the dynamic specification of name, the DECIMALS addition is not permitted.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make it a habit to read the F1 documentation thoroughly, one can learn so much from it &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 20:46:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-data-dynamic-issue/m-p/8047043#M1611441</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-08-09T20:46:50Z</dc:date>
    </item>
  </channel>
</rss>

