<?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 .....ENDIF in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464773#M553349</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;U can use 'or' and 'and' if u want to put the condition for both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF logexp. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Used for case distinction. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on whether the logical expression logexp is true or not, this statement triggers the execution of various sections of code enclosed by IF and ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three different types: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp. &lt;/P&gt;&lt;P&gt;  processing1 &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the logical expression is true, processing1 is executed. Otherwise, the program resumes immediately after ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp. &lt;/P&gt;&lt;P&gt;processing1 &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;processing2 &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the logical expression is true, processing1 is executed. Otherwise, processing2 is executed (see ELSE). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp1. &lt;/P&gt;&lt;P&gt;processing1 &lt;/P&gt;&lt;P&gt;ELSEIF logexp2. &lt;/P&gt;&lt;P&gt;processing2 &lt;/P&gt;&lt;P&gt;ELSEIF ... &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;processingN &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the logexp1 is false, logexp2 is evaluated and so on. You can use any number of ELSEIF statements. If an ELSE statement exists, it always appears after all the ELSEIF statements. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;All IF statements must be concluded in the same processing block by ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF statements can be nested as many times as you like. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IF statement does not directly affect the selection. For this purpose, you should use the CHECK statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;pritha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2007 07:34:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-22T07:34:10Z</dc:date>
    <item>
      <title>IF .....ENDIF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464769#M553345</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 2 check da condition of some variable for 2 values....in If ...ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.... how to write da code for&lt;/P&gt;&lt;P&gt;if ...a  = 1 or a = 6.&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 07:28:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464769#M553345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T07:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: IF .....ENDIF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464770#M553346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case it is better to use CASE .. ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE VAR.&lt;/P&gt;&lt;P&gt;WHEN 1.&lt;/P&gt;&lt;P&gt;    &amp;lt;STATEMENTS&amp;gt;.&lt;/P&gt;&lt;P&gt;WHEN 2.&lt;/P&gt;&lt;P&gt;    &amp;lt;STATEMENTS&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any how the syntax for IF .. ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF A = 1.&lt;/P&gt;&lt;P&gt;    &amp;lt;STATEMENTS&amp;gt;.&lt;/P&gt;&lt;P&gt;ELSEIF A = 2.&lt;/P&gt;&lt;P&gt;    &amp;lt;STATEMENTS&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if it is useful..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 07:31:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464770#M553346</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-06-22T07:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: IF .....ENDIF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464771#M553347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what you have written is the code.&lt;/P&gt;&lt;P&gt;if a = 1 or a = 2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same thing achieved by a case statament would be:&lt;/P&gt;&lt;P&gt;case a.&lt;/P&gt;&lt;P&gt;  when 1 or 2.&lt;/P&gt;&lt;P&gt;    processing...&lt;/P&gt;&lt;P&gt;  when others.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 07:32:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464771#M553347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T07:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: IF .....ENDIF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464772#M553348</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;&lt;/P&gt;&lt;P&gt;If A = 1 or A = 6.  " This will work if the A value is 1 or 6.&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;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 07:33:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464772#M553348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T07:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: IF .....ENDIF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464773#M553349</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;U can use 'or' and 'and' if u want to put the condition for both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF logexp. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Used for case distinction. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on whether the logical expression logexp is true or not, this statement triggers the execution of various sections of code enclosed by IF and ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three different types: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp. &lt;/P&gt;&lt;P&gt;  processing1 &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the logical expression is true, processing1 is executed. Otherwise, the program resumes immediately after ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp. &lt;/P&gt;&lt;P&gt;processing1 &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;processing2 &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the logical expression is true, processing1 is executed. Otherwise, processing2 is executed (see ELSE). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp1. &lt;/P&gt;&lt;P&gt;processing1 &lt;/P&gt;&lt;P&gt;ELSEIF logexp2. &lt;/P&gt;&lt;P&gt;processing2 &lt;/P&gt;&lt;P&gt;ELSEIF ... &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;processingN &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the logexp1 is false, logexp2 is evaluated and so on. You can use any number of ELSEIF statements. If an ELSE statement exists, it always appears after all the ELSEIF statements. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;All IF statements must be concluded in the same processing block by ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF statements can be nested as many times as you like. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IF statement does not directly affect the selection. For this purpose, you should use the CHECK statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;pritha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 07:34:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464773#M553349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T07:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: IF .....ENDIF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464774#M553350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF a = 1 or a=6.&lt;/P&gt;&lt;P&gt;  Write your logic.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If multiple if endif, prefer CASE -ENDCASE instead of IF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 07:36:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464774#M553350</guid>
      <dc:creator>alex_m</dc:creator>
      <dc:date>2007-06-22T07:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: IF .....ENDIF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464775#M553351</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;IF A = 1.&lt;/P&gt;&lt;P&gt;WRITE:/ 'A contains the value one'.&lt;/P&gt;&lt;P&gt;ELSEIF A = 6.&lt;/P&gt;&lt;P&gt;WRITE:/ 'A contains the value six'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;hari krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 07:37:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464775#M553351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T07:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: IF .....ENDIF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464776#M553352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexander&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp. &lt;/P&gt;&lt;P&gt;  processing1 &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;If the logical expression is true, processing1 is executed. Otherwise, the program resumes immediately after ENDIF&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp. &lt;/P&gt;&lt;P&gt;processing1 &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;processing2 &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the logical expression is true, processing1 is executed. Otherwise, processing2 is executed &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF logexp1. &lt;/P&gt;&lt;P&gt;processing1 &lt;/P&gt;&lt;P&gt;ELSEIF logexp2. &lt;/P&gt;&lt;P&gt;processing2 &lt;/P&gt;&lt;P&gt;ELSEIF ... &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;processingN &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the logexp1 is false, logexp2 is evaluated and so on. You can use any number of ELSEIF statements. If an ELSE statement exists, it always appears after all the ELSEIF statements. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Notes&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;1)All IF statements must be concluded in the same processing block by ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)IF statements can be nested as many times as you like. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)The IF statement does not directly affect the selection. For this purpose, you should use the CHECK statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;check this sample code&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF ITAB5-KSCHL = 'NAVS' OR ITAB5-KSCHL = 'NAVM'.

            ITAB1-KBETR = ITAB5-KBETR.

             modify  ITAB1 transporting KBETR
             where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP .


           ELSEIF ITAB5-KSCHL = 'FRA1' OR ITAB5-KSCHL = 'FRC1' OR
                ITAB5-KSCHL = 'FRB1'.

                   ITAB1-KWERT = ITAB5-KWERT .

                   modify  ITAB1 transporting KWERT
                   where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 07:39:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-endif/m-p/2464776#M553352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T07:39:25Z</dc:date>
    </item>
  </channel>
</rss>

