<?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: Find data type from value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294176#M788274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If its an elementary data types your expecting then you can use DESCRIBE FIELD statement and if classes and interfaces are invloved then you can use RTTS method.&lt;/P&gt;&lt;P&gt;Example : &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;REPORT typedescr_test. &lt;BR /&gt;&lt;BR /&gt;TYPES my_type TYPE i. &lt;BR /&gt;&lt;BR /&gt;DATA: my_data&amp;nbsp;&amp;nbsp; TYPE my_type, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; descr_ref TYPE ref to cl_abap_typedescr. &lt;BR /&gt;&lt;BR /&gt;START-OF-SELECTION. &lt;BR /&gt;&amp;nbsp; descr_ref = cl_abap_typedescr=&amp;gt;describe_by_data( my_data ). &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; WRITE: / 'Typename:', descr_ref-&amp;gt;absolute_name. &lt;BR /&gt;&amp;nbsp; WRITE: / 'Kind&amp;nbsp;&amp;nbsp;&amp;nbsp; :', descr_ref-&amp;gt;type_kind. &lt;BR /&gt;&amp;nbsp; WRITE: / 'Length&amp;nbsp; :', descr_ref-&amp;gt;length. &lt;BR /&gt;&amp;nbsp; WRITE: / 'Decimals:', descr_ref-&amp;gt;decimals.&lt;/STRONG&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Mar 2012 04:20:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-03-22T04:20:11Z</dc:date>
    <item>
      <title>Find data type from value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294171#M788269</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;I want to find data type from its value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex- If value = 1234 then its data type is numeric. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If value = ABCD then its data type is char. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So is there any FM which can tell the data type from its value or any way to do it. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Moderator Message: Offering points is against forum RoE.&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ashish Gupta&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Suhas Saha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 07:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294171#M788269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T07:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Find data type from value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294172#M788270</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; Use FM :  NUMERIC_CHECK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  This will give whether input value is numeric or Char.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 07:17:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294172#M788270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T07:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Find data type from value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294173#M788271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai.&lt;/P&gt;&lt;P&gt;check this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the five non-numeric types (text field (C), numeric text field (N), date field (D), time field (T), and hexadecimal field (X)), there are three numeric types, used in ABAP to display and calculate numbers. Data type N is not a numeric type. Type N objects can only contain numeric characters (0...9), but are not represented internally as numbers. Typical type N fields are account numbers and zip codes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;integers - type I&lt;/P&gt;&lt;P&gt;The value range of type I numbers is -2*&lt;STRONG&gt;31 to 2&lt;/STRONG&gt;*31-1 and includes only whole numbers. Non-integer results of arithmetic operations (e.g. fractions) are rounded, not truncated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use type I data for counters, numbers of items, indexes, time periods, and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Packed numbers - type P&lt;/P&gt;&lt;P&gt;Type P data allows digits after the decimal point. The number of decimal places is generic, and is determined in the program. The value range of type P data depends on its size and the number of digits after the decimal point. The valid size can be any value from 1 to 16 bytes. Two decimal digits are packed into one byte, while the last byte contains one digit and the sign. Up to 14 digits are allowed after the decimal point. The initial value is zero. When working with type P data, it is a good idea to set the program attribute Fixed point arithmetic.Otherwise, type P numbers are treated as integers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use type P data for such values as distances, weights, amounts of money, and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Floating point numbers - type F&lt;/P&gt;&lt;P&gt;The value range of type F numbers is 1x10*&lt;STRONG&gt;-307 to 1x10&lt;/STRONG&gt;*308 for positive and negative numbers, including 0 (zero). The accuracy range is approximately 15 decimals, depending on the floating point arithmetic of the hardware platform. Since type F data is internally converted to a binary system, rounding errors can occur. Although the ABAP processor tries to minimize these effects, you should not use type F data if high accuracy is required. Instead, use type P data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You use type F fields when you need to cope with very large value ranges and rounding errors are not critical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using I and F fields for calculations is quicker than using P fields. Arithmetic operations using I and F fields are very similar to the actual machine code operations, while P fields require more support from the software. Nevertheless, you have to use type P data to meet accuracy or value range requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C ---&amp;gt; character&lt;/P&gt;&lt;P&gt;D ---&amp;gt; date&lt;/P&gt;&lt;P&gt;P ---&amp;gt; packed&lt;/P&gt;&lt;P&gt;T ---&amp;gt; time&lt;/P&gt;&lt;P&gt;X ---&amp;gt; hexadecimal&lt;/P&gt;&lt;P&gt;I ---&amp;gt; integer.&lt;/P&gt;&lt;P&gt;N ---&amp;gt; Muneric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Possible ABAP/4 data types:&lt;/P&gt;&lt;P&gt;C: Character.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt; Date, format YYYYMMDD.&lt;/P&gt;&lt;P&gt;F: Floating-point number in DOUBLE PRECISION (8 bytes).&lt;/P&gt;&lt;P&gt;I: Integer.&lt;/P&gt;&lt;P&gt;N: Numerical character string of arbitrary length.&lt;/P&gt;&lt;P&gt;P: Amount or counter field (packed; implementation depends on hardware platform).&lt;/P&gt;&lt;P&gt;S: Time stamp YYYYMMDDHHMMSS.&lt;/P&gt;&lt;P&gt;T: Time of day HHMMSS.&lt;/P&gt;&lt;P&gt;V: Character string of variable length, length is given in the first two bytes.&lt;/P&gt;&lt;P&gt;X: Hexadecimal (binary) storage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;sowjanya.b.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 08:35:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294173#M788271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T08:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Find data type from value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294174#M788272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the links.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;link farm removed&amp;gt;&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;Sowjanya.b&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Suhas Saha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 08:40:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294174#M788272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T08:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find data type from value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294175#M788273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please use DESCRIBE FIELD &amp;lt;FIELD NAME&amp;gt; TYPE ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 03:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294175#M788273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-22T03:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Find data type from value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294176#M788274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If its an elementary data types your expecting then you can use DESCRIBE FIELD statement and if classes and interfaces are invloved then you can use RTTS method.&lt;/P&gt;&lt;P&gt;Example : &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;REPORT typedescr_test. &lt;BR /&gt;&lt;BR /&gt;TYPES my_type TYPE i. &lt;BR /&gt;&lt;BR /&gt;DATA: my_data&amp;nbsp;&amp;nbsp; TYPE my_type, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; descr_ref TYPE ref to cl_abap_typedescr. &lt;BR /&gt;&lt;BR /&gt;START-OF-SELECTION. &lt;BR /&gt;&amp;nbsp; descr_ref = cl_abap_typedescr=&amp;gt;describe_by_data( my_data ). &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; WRITE: / 'Typename:', descr_ref-&amp;gt;absolute_name. &lt;BR /&gt;&amp;nbsp; WRITE: / 'Kind&amp;nbsp;&amp;nbsp;&amp;nbsp; :', descr_ref-&amp;gt;type_kind. &lt;BR /&gt;&amp;nbsp; WRITE: / 'Length&amp;nbsp; :', descr_ref-&amp;gt;length. &lt;BR /&gt;&amp;nbsp; WRITE: / 'Decimals:', descr_ref-&amp;gt;decimals.&lt;/STRONG&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 04:20:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-data-type-from-value/m-p/3294176#M788274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-22T04:20:11Z</dc:date>
    </item>
  </channel>
</rss>

