<?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 statement Execution Error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764207#M37360</link>
    <description>&lt;P&gt;Hello Anurag,&lt;/P&gt;&lt;P&gt;Replace your first IF condition with a range table. &lt;/P&gt;&lt;P&gt;Something like IF lv_flstr IN lt_range_table.  &lt;/P&gt;&lt;P&gt;This will solve your issue. &lt;/P&gt;&lt;P&gt;Also, if you want to go ahead with the code that you have written, replace the AND with an OR and it should work fine. &lt;/P&gt;</description>
    <pubDate>Fri, 25 Jan 2019 07:35:50 GMT</pubDate>
    <dc:creator>tamitdassharma</dc:creator>
    <dc:date>2019-01-25T07:35:50Z</dc:date>
    <item>
      <title>IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764206#M37359</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;Sorry to bother but I didn't know how to put up the question in better way than this.&lt;/P&gt;
  &lt;P&gt;If you have another thread for this query, kindly lead me to that thread.&lt;/P&gt;
  &lt;P&gt;I have a condition in code and the problem is that when the condition check is reached, the code is exited irrespective of the result of IF condition i.e., neither True nor False part is getting executed.&lt;/P&gt;
  &lt;P&gt;Please find below the code to understand the scenario.&lt;/P&gt;
  &lt;P&gt;1 is the IF condition.&lt;/P&gt;
  &lt;P&gt;2 is the True part of IF condition.&lt;/P&gt;
  &lt;P&gt;3 is the area of code which is out of so many nested conditions and is getting executed just after 1 instead of True or False part.&lt;/P&gt;
  &lt;P&gt;So, why is 2 not getting executed even if the value of 1 is True?&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/266524-pm-error-1.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/266525-pm-error-2.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I am not able to figure out why is it happening and how to fix it.&lt;/P&gt;
  &lt;P&gt;Thanks,&lt;/P&gt;
  &lt;P&gt;Anurag&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 07:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764206#M37359</guid>
      <dc:creator>anurag_singh16</dc:creator>
      <dc:date>2019-01-25T07:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764207#M37360</link>
      <description>&lt;P&gt;Hello Anurag,&lt;/P&gt;&lt;P&gt;Replace your first IF condition with a range table. &lt;/P&gt;&lt;P&gt;Something like IF lv_flstr IN lt_range_table.  &lt;/P&gt;&lt;P&gt;This will solve your issue. &lt;/P&gt;&lt;P&gt;Also, if you want to go ahead with the code that you have written, replace the AND with an OR and it should work fine. &lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 07:35:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764207#M37360</guid>
      <dc:creator>tamitdassharma</dc:creator>
      <dc:date>2019-01-25T07:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764208#M37361</link>
      <description>&lt;P&gt;"So, why is 2 not getting executed even if the value of 1 is True?" &lt;/P&gt;&lt;P&gt;Because the value of 1 is &lt;STRONG&gt;not&lt;/STRONG&gt; true.&lt;/P&gt;&lt;P&gt;Set a breakpoint at 1. Run your program. Examine the values of&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;lv_flstr&lt;/LI&gt;&lt;LI&gt;lv_low&lt;/LI&gt;&lt;LI&gt;lv_high&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If you still can't figure out the issue from that, then comment on this answer with the values of these variables, and their defined types.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 07:51:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764208#M37361</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-01-25T07:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764209#M37362</link>
      <description>&lt;P&gt;This is not good advice. You have no idea where the lv_low and lv_high are being set, nor the context of the program. &lt;/P&gt;&lt;P&gt;You certainly cannot declare "this will solve your issue".&lt;/P&gt;&lt;P&gt;Anyway, it's far more important for the OP to understand &lt;EM&gt;why&lt;/EM&gt; there's an issue with his code, then he just gets a "fix". If he follows your advice and by some chance it works, then all he's doing is &lt;A href="https://pragprog.com/the-pragmatic-programmer/extracts/coincidence" target="_blank"&gt;programming by coincidence&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 07:54:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764209#M37362</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-01-25T07:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764210#M37363</link>
      <description>&lt;P&gt;Hi Anurag,&lt;/P&gt;&lt;P&gt;Is there any &lt;EM&gt;&lt;STRONG&gt;Else&lt;/STRONG&gt;&lt;/EM&gt; statement part found for the &lt;EM&gt;&lt;STRONG&gt;first if&lt;/STRONG&gt;&lt;/EM&gt; condition ??. Suppose if it is not there and condition fails, It would directly go to the line after the &lt;EM&gt;&lt;STRONG&gt;Endif&lt;/STRONG&gt;&lt;/EM&gt; statement of first if condition ( may be in your case line no: 159 )&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if lv_flstr ge lv_low and lv_flstr le lv_high.
  read table...
  if
  endif
  if
  endif...
Else &amp;lt;--- search for this


endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So please check the Else part is available or not for the first if condition.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 08:20:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764210#M37363</guid>
      <dc:creator>Muthu_raja</dc:creator>
      <dc:date>2019-01-25T08:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764211#M37364</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;matthew.billingham&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;It is clearly evident from the piece of code posted by  &lt;SPAN class="mention-scrubbed"&gt;anurag.singh16&lt;/SPAN&gt; that he is trying to execute a piece of code - labelled 2 in the screenshot when the condition in label 1 is fulfilled. &lt;/P&gt;&lt;P&gt;If you read the statement properly it is clear that he is comparing the value of &lt;STRONG&gt;lv_flstr&lt;/STRONG&gt; to be in between &lt;STRONG&gt;lv_low&lt;/STRONG&gt; and &lt;STRONG&gt;lv_high&lt;/STRONG&gt; including both the limits. Hence I have suggested using a range table in place of that. I hope you will understand it better if you try to dry run the statement.&lt;/P&gt;&lt;P&gt;For the second suggestion of using OR. Since anurag has used the and operator and considering the value of &lt;STRONG&gt;lv_flstr&lt;/STRONG&gt; to be greater than equal to &lt;STRONG&gt;lv_low&lt;/STRONG&gt; the predecessor of the &lt;STRONG&gt;AND &lt;/STRONG&gt;operator always forms to be true and the second part is considered to be false. And we all know any comparison including &lt;STRONG&gt;AND &lt;/STRONG&gt;operator&lt;STRONG&gt; &lt;/STRONG&gt;like &lt;STRONG&gt;(True AND False) will always result in false.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is not &lt;EM&gt;programming by coincidence&lt;/EM&gt; but understanding each line of code.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope you will try to understand answers provided by community users before criticizing.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:08:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764211#M37364</guid>
      <dc:creator>tamitdassharma</dc:creator>
      <dc:date>2019-01-25T09:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764212#M37365</link>
      <description>&lt;P&gt;Hi Muthu,&lt;/P&gt;&lt;P&gt;The code was working fine till yesterday. &lt;/P&gt;&lt;P&gt;It has just come up yesterday evening.&lt;/P&gt;&lt;P&gt;Still we are figuring out the reason for the same.&lt;/P&gt;&lt;P&gt;And also, the else part if added to check if the false reaches to Else or not, but failing to get even there.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anurag Singh&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:19:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764212#M37365</guid>
      <dc:creator>anurag_singh16</dc:creator>
      <dc:date>2019-01-25T09:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764213#M37366</link>
      <description>&lt;P&gt;Hi Matthew,&lt;/P&gt;&lt;P&gt;The value of below variables at run time is as follows:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;lv_flstr   -&amp;gt;  85&lt;/LI&gt;&lt;LI&gt;lv_low   -&amp;gt;  80&lt;/LI&gt;&lt;LI&gt;lv_high -&amp;gt;  100&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So I guess, the value of IF  is True. right ?&lt;/P&gt;&lt;P&gt;And also if it's False, then it should reach out to Else part of the same IF condition.&lt;/P&gt;&lt;P&gt;Now suggest.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:22:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764213#M37366</guid>
      <dc:creator>anurag_singh16</dc:creator>
      <dc:date>2019-01-25T09:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764214#M37367</link>
      <description>&lt;P&gt;Ok I doubt whether the Else part was added recently is corresponding to the first if condition. Ok please confirm once the if condition fails which line it was going ?? &lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:29:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764214#M37367</guid>
      <dc:creator>Muthu_raja</dc:creator>
      <dc:date>2019-01-25T09:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764215#M37368</link>
      <description>&lt;P&gt;He also asked for their defined types, since that might also have an influence.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:30:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764215#M37368</guid>
      <dc:creator>ArthurParisius</dc:creator>
      <dc:date>2019-01-25T09:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764216#M37369</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;dassharma&lt;/SPAN&gt; : criticizing is always a good thing if it's fair and argumented (not done in a "lynch mob" way), and I find Matthew's comment fair and argumented, sorry to say that. Now, about your answer, I don't understand how it would help the OP solve his issue. Matthew's answer is better: it doesn't go in the "true" block of the IF because the condition is false, simple as that. Now, probably there's something tricky somewhere, and the question doesn't give clues what it can be... PS: please, don't bold your last sentences, it sounds like "yelling".&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:44:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764216#M37369</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-01-25T09:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764217#M37370</link>
      <description>&lt;P&gt;Is it possible that you didn't restart your program ? (i.e. the source code in the debugger refers to the current source code, but the real code executed corresponds the old compiled code/old source code)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:46:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764217#M37370</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-01-25T09:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764218#M37371</link>
      <description>&lt;P&gt;Sorry  &lt;SPAN class="mention-scrubbed"&gt;dassharma&lt;/SPAN&gt; but I disagree.&lt;/P&gt;&lt;P&gt;I'm well aware of the fact that he's doing a simple "BETWEEN". And there's nothing wrong with that. &lt;/P&gt;&lt;P&gt; I find your suggestion that he convert that into a range is over complicating the issue. A range could contain anything - include patterns, exclusions etc. &lt;STRONG&gt;IN range&lt;/STRONG&gt; is semantically very different from a simple comparison of low and high. Since programming should be a specific as possible to avoid unwanted side effects, it's not a good idea to add a generalisation such as a range, when a simple between test is what is required. If you've ever programmed in HR or used time-dependent infoobjects in BW, you'll frequently use BEGDA and ENDDA. To use a range to see if something lies between begda and endda would not be sensible.&lt;/P&gt;&lt;P&gt;On that basis I say your advice is not good.  &lt;/P&gt;&lt;P&gt;Furthermore replacing the between with a range could end up with &lt;STRONG&gt;him &lt;/STRONG&gt;programming by coincidence if &lt;STRONG&gt;he &lt;/STRONG&gt;doesn't understand why the code is failing the first place.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;On your second point concerning OR (which I've not commented on so far), unless I've entirely misunderstood, you're simply wrong. The OP gave us these values:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;lv_flstr -&amp;gt; 85&lt;/LI&gt;&lt;LI&gt;lv_low -&amp;gt; 80&lt;/LI&gt;&lt;LI&gt;lv_high -&amp;gt; 100&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(lv_flstr) = 85.
DATA(lv_low) = 80.
DATA(lv_high) = 100.

IF lv_flstr GE lv_low AND lv_flstr LE lv_high.
  WRITE / 'In between'.
ELSE.
  WRITE / 'Not in between'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;Is 85 greater than or equal to 80. &lt;STRONG&gt;True&lt;/STRONG&gt;&lt;BR /&gt;Is 85 less than or equal to 100. &lt;STRONG&gt;True&lt;/STRONG&gt;.&lt;P&gt;Output "In between".&lt;BR /&gt;&lt;BR /&gt;You propose&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If lv_flstr GE lv_low OR lv_flstr LE lv_high.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Consider lv_low = 80 and lv_high = 100. The following values of lv_flstr will give this clause as true.&lt;BR /&gt;75, 80, 105.&lt;BR /&gt;Which is probably &lt;EM&gt;not&lt;/EM&gt; what he wants.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:49:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764218#M37371</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-01-25T09:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764219#M37372</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;anurag.singh16&lt;/SPAN&gt; The value of the IF is true. But only if you've got your typing right. &lt;/P&gt;&lt;P&gt;"If you still can't figure out the issue from that, then comment on this answer with the values of these variables,&lt;STRONG&gt; and their defined types&lt;/STRONG&gt;."&lt;/P&gt;&lt;P&gt;If the types are numeric, then another possibility is that the program/include isn't activated,and the runtime is not the same version as what you see in the editor.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:52:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764219#M37372</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-01-25T09:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764220#M37373</link>
      <description>&lt;P&gt;This is where my thoughts are going. &lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 10:16:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764220#M37373</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-01-25T10:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764221#M37374</link>
      <description>&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;Thank you all. And please don't take it as argument. We are helping each other to clear the doubts and there can be a bit of difference in opinions and approach towards problem. &lt;/P&gt;&lt;P&gt;So, let's take it lightly and chill.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;&lt;P&gt;I cracked it now.&lt;/P&gt;&lt;P&gt;I commented the original statement and split the condition into 2 parts as below.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/266532-pm-error-fix.png" /&gt;&lt;/P&gt;&lt;P&gt;It is working fine now.&lt;/P&gt;&lt;P&gt;But the question is why was it not working earlier only from past 24 hours. Before yesterday that query was working absolutely fine and accordingly.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Anurag &lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 10:23:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764221#M37374</guid>
      <dc:creator>anurag_singh16</dc:creator>
      <dc:date>2019-01-25T10:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764222#M37375</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;May be you are right.&lt;/P&gt;&lt;P&gt;But I got this error last evening reported by Client. Then I checked into my system late night and found this again.&lt;/P&gt;&lt;P&gt;Then I came office and checked again in the morning, found the same error in both, Dev and Quality System. So, that possibility is eliminated for now in my case.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Anurag &lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 10:27:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764222#M37375</guid>
      <dc:creator>anurag_singh16</dc:creator>
      <dc:date>2019-01-25T10:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764223#M37376</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;IF lv_flstr GE lv_low AND lv_flstr LE lv_high. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is logically identical to &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF lv_flstr GE lv_low.
  IF lv_flstr LE lv_high. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is&lt;STRONG&gt; absolutely no way&lt;/STRONG&gt; that the first doesn't work and the second does, unless you have not given us accurate and complete information. I'd suggest that either you're testing with different data (you still haven't told us the types of the three variables), or you're not showing us the actual code (this happens, it's easy to do).&lt;/P&gt;&lt;P&gt;I'm now rather worried for you. About two things.&lt;/P&gt;&lt;P&gt;1) You posted originally.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF lv_flstr GE lv_low AND lv_flstr LE lv_high.
  READ ...
  IF sy-subrc = 0.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It looks like you've replaced that with&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF lv_flstr GE lv_low.
  IF lv_flstr LE lv_high.
    IF sy-subrc = 0.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Where's the READ gone?&lt;/P&gt;&lt;P&gt;2) You say you've cracked it, and it's working fine. But that's only half the story. You (and us) still don't understand why it wasn't working before. If don't get that understanding, then you are&lt;EM&gt; programming by coincidence&lt;/EM&gt;, which, if you follow the link I post earlier, you should understand is a very dangerous thing to do. &lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 11:16:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764223#M37376</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-01-25T11:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764224#M37377</link>
      <description>&lt;P&gt;I agree 100% with Matthew&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 12:38:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764224#M37377</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-01-25T12:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement Execution Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764225#M37378</link>
      <description>&lt;P&gt;Hi Matthew,&lt;/P&gt;&lt;P&gt;Me and my functional both sat together and checked in debugging mode. It worked then, but now again it's creating the problem.&lt;/P&gt;&lt;P&gt;I'll share the details. &lt;/P&gt;&lt;P&gt;Now, the problem is coming at below condition:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;1.   IF lv_flstr GE lv_low.   "This was working fine this time around 2 hours back
         IF lv_flstr LE lv_high.  "This was working fine this time around 2 hours back



2.   IF lv_flstr GE lv_low.   "This is working fine now also
         IF lv_flstr LE lv_high.  "But this is creating same problem again i.e., exiting out of code block

Regarding Data Types of all variables in condition statement:

1. lv_flstr  -&amp;gt; char15  
2. lv_low    -&amp;gt; char5
3. lv_high   -&amp;gt; char5
4. lv_flstr1 -&amp;gt; char5

I am fetching 'lv_flstr' after splitting a variable by '-' into lv_low and lv_high.
Earlier lv_flstr was used in condition, then I moved lv_flstr to lv_flstr1 and replaced lv_flstr with lv_flstr1 in  condition.


&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I guess the problem is from the beginning and data type has to be corrected for all.&lt;/P&gt;&lt;P&gt;Let me know if any further details required.&lt;/P&gt;&lt;P&gt;Regards, &lt;BR /&gt;Anurag&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 14:24:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-execution-error/m-p/764225#M37378</guid>
      <dc:creator>anurag_singh16</dc:creator>
      <dc:date>2019-01-25T14:24:23Z</dc:date>
    </item>
  </channel>
</rss>

