<?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: condition problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701039#M625515</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 query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT trans lifnr xblnr usnam appdate status&lt;/P&gt;&lt;P&gt;FROM zinv_mov INTO TABLE lt_mov&lt;/P&gt;&lt;P&gt;WHERE  appdate &amp;lt;b&amp;gt;between&amp;lt;/b&amp;gt; zinv_reg-inv_date AND zinv_reg-invr_date  OR  trans  &amp;lt;b&amp;gt;between&amp;lt;/b&amp;gt; zinv_mov-trans and  trans-high OR usnam EQ name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also in your if condition you are checking if they are INITIAL, you want to check if they are initial or NOT initial?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Aug 2007 08:27:04 GMT</pubDate>
    <dc:creator>seshatalpasai_madala</dc:creator>
    <dc:date>2007-08-27T08:27:04Z</dc:date>
    <item>
      <title>condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701031#M625507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is any thing wrong with the statement, inv_date and invr_date is type date, trans and trans-high is NUMC and usname is char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF NOT ( (  zinv_reg-inv_date IS INITIAL&lt;/P&gt;&lt;P&gt;                AND zinv_reg-invr_date IS INITIAL )&lt;/P&gt;&lt;P&gt;                OR ( zinv_mov-trans IS INITIAL&lt;/P&gt;&lt;P&gt;                AND trans-high IS INITIAL )&lt;/P&gt;&lt;P&gt;                OR usname IS INITIAL ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          SELECT trans lifnr xblnr usnam appdate status&lt;/P&gt;&lt;P&gt;                  FROM zinv_mov INTO TABLE lt_mov&lt;/P&gt;&lt;P&gt;                  WHERE ( appdate GE zinv_reg-inv_date&lt;/P&gt;&lt;P&gt;                  AND appdate LE zinv_reg-invr_date )&lt;/P&gt;&lt;P&gt;                  OR ( trans GE zinv_mov-trans&lt;/P&gt;&lt;P&gt;                  AND trans LE trans-high )&lt;/P&gt;&lt;P&gt;                  OR usnam EQ name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 07:45:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701031#M625507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T07:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701032#M625508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Turbin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   No need of checking subrc value in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   IF NOT ( zinv_reg-inv_date IS INITIAL AND zinv_reg-invr_date IS INITIAL )&lt;/P&gt;&lt;P&gt;         OR ( zinv_mov-trans IS INITIAL AND trans-high IS INITIAL )&lt;/P&gt;&lt;P&gt;         OR usname IS INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT trans lifnr xblnr usnam appdate status&lt;/P&gt;&lt;P&gt;FROM zinv_mov INTO TABLE lt_mov&lt;/P&gt;&lt;P&gt;WHERE ( appdate GE zinv_reg-inv_date&lt;/P&gt;&lt;P&gt;AND appdate LE zinv_reg-invr_date )&lt;/P&gt;&lt;P&gt;OR ( trans GE zinv_mov-trans&lt;/P&gt;&lt;P&gt;AND trans LE trans-high )&lt;/P&gt;&lt;P&gt;OR usnam EQ name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if this helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 07:49:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701032#M625508</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T07:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701033#M625509</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;Your IF condition checks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) IF both zinv_reg-inv_date and zinv_reg-invr_date are not INITIAL. So if this condition is true ,that is if both these dates are not initial your other conditions(Checking of TRANS HIGH and USNAME) will never be checked since you are using OR and in the case of OR the second condition will be checked only of First condition is FALSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you want or something else just find out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;also could not understand why you are using IF sy-subrc = 0.?&amp;lt;/b&amp;gt; First IF itself is enough..&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 07:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701033#M625509</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-08-27T07:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701034#M625510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually my condition is that if inv_date and invr_date is initial or trans and trans-high is initial or usnam is intial then the select querry should execute.&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;&lt;/P&gt;&lt;P&gt;Line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 07:56:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701034#M625510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T07:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701035#M625511</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;Following if should be enough&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF  ( zinv_reg-inv_date IS INITIAL
AND zinv_reg-invr_date IS INITIAL ) " Check if these two or inittial
 OR ( zinv_mov-trans IS INITIAL " Else check if these two or initial, this will be checked only if first condition is false that is one of the dates are not initial.
AND trans-high IS INITIAL ) 
 OR usname IS INITIAL . " Else check if usname is initial

* execute select query here
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 07:59:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701035#M625511</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-08-27T07:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701036#M625512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF (zinv_reg-INV_DATE IS INITIAL&lt;/P&gt;&lt;P&gt; AND zinv_reg-INVR_DATE IS INITIAL) OR &lt;/P&gt;&lt;P&gt;( zinv_mov-TRANS IS INITIAL AND &lt;/P&gt;&lt;P&gt;zinv_mov-TRANS_HIGH IS INITIAL) OR&lt;/P&gt;&lt;P&gt;USNAM IS INITIAL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 08:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701036#M625512</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T08:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701037#M625513</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;But the select querry is picking all the records from the database it is not selecting based on the condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 08:10:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701037#M625513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T08:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701038#M625514</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;As said I changed the code in the if condition but what is wrong with my select querry it is picking all the records from the data base.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 08:23:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701038#M625514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T08:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701039#M625515</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 query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT trans lifnr xblnr usnam appdate status&lt;/P&gt;&lt;P&gt;FROM zinv_mov INTO TABLE lt_mov&lt;/P&gt;&lt;P&gt;WHERE  appdate &amp;lt;b&amp;gt;between&amp;lt;/b&amp;gt; zinv_reg-inv_date AND zinv_reg-invr_date  OR  trans  &amp;lt;b&amp;gt;between&amp;lt;/b&amp;gt; zinv_mov-trans and  trans-high OR usnam EQ name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also in your if condition you are checking if they are INITIAL, you want to check if they are initial or NOT initial?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 08:27:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-problem/m-p/2701039#M625515</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-08-27T08:27:04Z</dc:date>
    </item>
  </channel>
</rss>

