<?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: numeric values not getting compared properly in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-values-not-getting-compared-properly/m-p/11386133#M1923947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For me the solution is pretty obvious, but offcourse I don't know the restrictions you might have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to compare two fields, why do you not declare them the same way ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Parameters : p_days type &lt;SPAN style="color: #333333; font-size: 12px;"&gt;ZZVALUEL.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;And if that is not possible maybe you can declare another field where you move the parameter to before compare&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;data: lv_days type &lt;SPAN style="color: #333333; font-size: 12px;"&gt;ZZVALUEL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Parameters: p_days(5) type c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;* do your checks for numeric and then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;lv_days = p_days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;And now compare lv_days with the global variable in stead of p_days.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2015 12:46:57 GMT</pubDate>
    <dc:creator>PeterJonker</dc:creator>
    <dc:date>2015-12-16T12:46:57Z</dc:date>
    <item>
      <title>numeric values not getting compared properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-values-not-getting-compared-properly/m-p/11386132#M1923946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one parameter on my selection screen, and other is global variable of the type&amp;nbsp; Z-table field which is having a numeric value and the&amp;nbsp; parameter is of type char but can have only numeric values, therefore I applied a numeric check for that and applied condense statement so that it compares it with the numeric field correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaration: &lt;/P&gt;&lt;P&gt;Data : gv_value type ZZVALUEL (it is the numeric field)&lt;/P&gt;&lt;P&gt;Parameters : p_days(5)&amp;nbsp; type c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is when I am executing the statement :&lt;/P&gt;&lt;P&gt; if p_days LT gv_value .&lt;/P&gt;&lt;P&gt;Message 'the value should be greater or equal to &amp;lt;gv_value&amp;gt;' .&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gv_value is 720 in the table&lt;/P&gt;&lt;P&gt;entering p_days = 999&lt;/P&gt;&lt;P&gt; error is not coming , but when entering 1000 or above it displays the error even though it is the greater value than gv_value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 06:22:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-values-not-getting-compared-properly/m-p/11386132#M1923946</guid>
      <dc:creator>former_member377099</dc:creator>
      <dc:date>2015-12-16T06:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: numeric values not getting compared properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-values-not-getting-compared-properly/m-p/11386133#M1923947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For me the solution is pretty obvious, but offcourse I don't know the restrictions you might have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to compare two fields, why do you not declare them the same way ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Parameters : p_days type &lt;SPAN style="color: #333333; font-size: 12px;"&gt;ZZVALUEL.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;And if that is not possible maybe you can declare another field where you move the parameter to before compare&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;data: lv_days type &lt;SPAN style="color: #333333; font-size: 12px;"&gt;ZZVALUEL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Parameters: p_days(5) type c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;* do your checks for numeric and then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;lv_days = p_days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;And now compare lv_days with the global variable in stead of p_days.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 12:46:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-values-not-getting-compared-properly/m-p/11386133#M1923947</guid>
      <dc:creator>PeterJonker</dc:creator>
      <dc:date>2015-12-16T12:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: numeric values not getting compared properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-values-not-getting-compared-properly/m-p/11386134#M1923948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tanya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of Type C which is of length 5 is the real problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use Type C for variable p_days the it will internally convert 720 as 00999 where as your gt_value is 720 always as it is Numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can never be compared and your condition fails always.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Type N or take another variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_days2 type N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P_days2 = p_days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If p_days2 LT gt_value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message 'XXXXXXXXXXXXXXXXXXXXXXXXX'.&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;This will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Veera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 14:44:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-values-not-getting-compared-properly/m-p/11386134#M1923948</guid>
      <dc:creator>bavisettiveera_prakash</dc:creator>
      <dc:date>2015-12-16T14:44:50Z</dc:date>
    </item>
  </channel>
</rss>

