<?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: If Condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201307#M1521287</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nothing wrong with the IF condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amount type declaration is converting the amount to the nearest integer that is one. In debugging you will see the value and understand why the IF condition is failing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Aug 2010 20:34:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-19T20:34:17Z</dc:date>
    <item>
      <title>If Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201302#M1521282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a requirement where in i have to check for amount field should be between -1 and 1.&lt;/P&gt;&lt;P&gt;I have kept the condition as amount_field LE 1 and amount_field GT -1. But the problem is it is passing any thing less between -1.5 to 1.5. Pls let me know how to put this condition so it will take between -1 and 1.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 13:29:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201302#M1521282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-19T13:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201303#M1521283</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;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If amount_field gt  '-1' and amount_field lt '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: venkatramana k on Aug 19, 2010 7:05 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 13:34:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201303#M1521283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-19T13:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201304#M1521284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you have decimals in the field?  You're being affected by the rounding for that data type? Try something like:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: lv_low(5) type p decimals 1 value '-1.0',  "or same type as your data.
        lv_high(5) type p decimals 1 value '1.0'.

If &amp;lt;field&amp;gt; gt lv_low and &amp;lt;field&amp;gt; lt lv_high.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 13:52:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201304#M1521284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-19T13:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201305#M1521285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TYPES : BEGIN Of TP_VAL1,&lt;/P&gt;&lt;P&gt;          val1 TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;        end of tp_val1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wl_val1 type tp_val1,&lt;/P&gt;&lt;P&gt;            t_val1 TYPE STANDARD TABLE OF tp_val1,&lt;/P&gt;&lt;P&gt;           w_custom TYPE int2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_val1-val1 = '1.2'. APPEND wl_val1 to t_val1.&lt;/P&gt;&lt;P&gt;wl_val1-val1 = '0.9'. APPEND wl_val1 to t_val1.&lt;/P&gt;&lt;P&gt;wl_val1-val1 = '-0.6'. APPEND wl_val1 to t_val1.&lt;/P&gt;&lt;P&gt;wl_val1-val1 = '1.9'. APPEND wl_val1 to t_val1.&lt;/P&gt;&lt;P&gt;wl_val1-val1 = '-1.6'. APPEND wl_val1 to t_val1.&lt;/P&gt;&lt;P&gt;wl_val1-val1 = '1.49'. APPEND wl_val1 to t_val1.&lt;/P&gt;&lt;P&gt;wl_val1-val1 = '-1.46'. APPEND wl_val1 to t_val1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear w_custom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_val1 INTO wl_val1.&lt;/P&gt;&lt;P&gt;   IF wl_val1-val1 LE  '1' AND wl_val1-val1 GT '1'.   "Same as what you have given&lt;/P&gt;&lt;P&gt;     ADD 1 TO w_custom.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output i'm getting is 2 ( which is correct )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you check again?  I don't believe there is a problem in the IF statement. Problem could be in the data type of amount_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sujay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 13:53:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201305#M1521285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-19T13:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201306#M1521286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont think you need a lt and gt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if lv_val between '-1' and '1'.&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;Also check the decimals places, type i will just convert the decimal value to its nearest integer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 17:42:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201306#M1521286</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-08-19T17:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201307#M1521287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nothing wrong with the IF condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amount type declaration is converting the amount to the nearest integer that is one. In debugging you will see the value and understand why the IF condition is failing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 20:34:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201307#M1521287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-19T20:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201308#M1521288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;nothing wrong with the if the problem can be the rounding try using 1 decimal or use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: ZM_PRUEBA(3) TYPE P DECIMALS 2 VALUE '1.2'.

IF ZM_PRUEBA BETWEEN 1 and -1.
 WRITE: 'fail'.
ELSE.
 WRITE: 'done'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 21:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-condition/m-p/7201308#M1521288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-19T21:47:11Z</dc:date>
    </item>
  </channel>
</rss>

